如何在Arch Linux中安装OpenGL头文件

时间:2018-03-22 17:01:26

标签: c++ opengl header-files archlinux

我正在使用Arch linux并尝试使用C ++学习GLFW。我需要在我的程序中包含OpenGL头文件。我在QtCreator中关注了cmake文件: -

cmake_minimum_required(VERSION 2.8)

 find_package(glfw3 3.2 REQUIRED)
 find_package(OpenGL REQUIRED)

 project(gt)
 add_executable(${PROJECT_NAME} "main.cpp")

 target_include_directories(myapp ${OPENGL_INCLUDE_DIR})
 target_link_libraries(gt ${OPENGL_gl_LIBRARY})
 target_link_libraries(gt ${OPENGL_glu_LIBRARY})

但QtCreator无法配置文件,我得到了错误: -

/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137: error: Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY OPENGL_INCLUDE_DIR) /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.10/Modules/FindOpenGL.cmake:369 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:4 (find_package)

:-1: error: Configuration failed.

我在安装arch linux时已经安装了base-devel

这里是glxinfo | grep OpenGL命令的输出: -

$ glxinfo | grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ironlake Mobile 
OpenGL version string: 2.1 Mesa 17.3.7
OpenGL shading language version string: 1.20
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 17.3.7
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
OpenGL ES profile extensions:

0 个答案:

没有答案