CMake在Ubuntu中找不到OpenGL [英] CMake could not find OpenGL in Ubuntu

查看:1508
本文介绍了CMake在Ubuntu中找不到OpenGL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Ubuntu中安装VTK. CMake向我发送此错误:

I want to install VTK in Ubuntu. CMake sends me this error :

CMake错误于 /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (消息):找不到OpenGL(丢失:OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR)调用堆栈(最近调用优先):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindOpenGL.cmake:161 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
Rendering/OpenGL/CMakeLists.txt:196(find_package)

CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message): Could NOT find OpenGL (missing: OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR) Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindOpenGL.cmake:161 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
Rendering/OpenGL/CMakeLists.txt:196 (find_package)

CMake错误:此项目中使用了以下变量,但 它们设置为NOTFOUND.请设置它们或确保已设置它们 并在CMake文件中正确测试:OPENGL_INCLUDE_DIR(ADVANCED) 用作目录中的包含目录 /home/pilou/Documents/src/VTK-6.2.0/Geovis/Core

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: OPENGL_INCLUDE_DIR (ADVANCED) used as include directory in directory /home/pilou/Documents/src/VTK-6.2.0/Geovis/Core

因此,我已经安装了freeglut3和build-essential(如我在Internet上所见).但是什么都没有改变.

I have hence installed freeglut3 and build-essential (as I have seen on Internet). But nothing has changed.

我如何找到opengl来编写自己的CMake链接?我还能做些什么来安装VTK?

How could I find opengl to write my own link to CMake? What else could I do to install VTK?

推荐答案

EDIT在 answer 之后,我们不需要安装freeglut(适用于Windows的SDK),但安装台面就足够了.

EDIT Following the answer, we don't need to install freeglut (SDK for windows) but installing mesa is enough.

您可以安装台面OpenGL实现.请参见 answer 中的指示.

You can install mesa an implementation of OpenGL. See indications in the answer.

因此,如果您遇到以下错误:

Therefore, if you have an error such that:

找不到OpenGL

Could NOT find OpenGL

然后,您要安装libgl1-mesa-dev.使用基于debian的系统:

Then, you want to install libgl1-mesa-dev. With debian-based system:

sudo apt-get install libgl1-mesa-dev

对于错误,例如:

找不到OpenGL(缺少:EGL)

Could NOT find OpenGL (missing: EGL)

然后,您要安装libgl1-mesa-dev.使用基于debian的系统:

Then, you want to install libgl1-mesa-dev. With debian-based system:

sudo apt-get install libegl1-mesa-dev

这篇关于CMake在Ubuntu中找不到OpenGL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆