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

查看:75
本文介绍了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_LIBRARYOPENGL_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)
渲染/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(正如我在互联网上看到的那样).但一切都没有改变.

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)但是安装mesa就够了.

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

您可以安装台面实现 OpenGL.请参阅答案中的指示.

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

因此,如果您有以下错误:

Therefore, if you have an error such that:

找不到 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天全站免登陆