Ubuntu下cmake报错:Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
Posted Z.Q.Feng
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu下cmake报错:Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)相关的知识,希望对你有一定的参考价值。
文章目录
一、项目场景
- 系统:
Ubuntu20.04
- cmake版本:
cmake3.16.3
- gcc、g++版本:
gcc-9.4.0、g++-9.4.0
二、报错信息
报错如下:
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.16/Modules/FindGLUT.cmake:130 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:24 (find_package)
关键报错信息:
Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
三、解决办法
安装包含 GLUT
的依赖库:
sudo apt-get install freeglut3-dev
问题解决。
以上是关于Ubuntu下cmake报错:Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)的主要内容,如果未能解决你的问题,请参考以下文章