ubuntu编译9.3.0 vtk报错 -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY OpenGL) CMake Error at CMake/vtkModule.cmake:4793 (message): Could not find the OpenGL external dependency. Call Stack (most recent call first): CMake/vtkModule.cmake:5393 (vtk_module_find_package) Utilities/OpenGL/CMakeLists.txt:58 (vtk_module_third_party_external) -- Configuring incomplete, errors occurred! See also "/home/kj/catkin_ws/VTK-9.3.0/build/CMakeFiles/CMakeOutput.log". See also "/home/kj/catkin_ws/VTK-9.3.0/build/CMakeFiles/CMakeError.log".
如果没安装就去安装,没的说,网上都有安装教程,下面命令确认是否安装的
sudo apt-get install mesa-utils
glxinfo | grep "OpenGL version"
查找opengl的位置
sudo find / -name libGL.so 2>/dev/null
查找glu的位置
sudo find / -name libGLU.so 2>/dev/null
然后cmake .. 改成如下所示,路径改成你自己的
cmake -DOPENGL_gl_LIBRARY=/usr/lib/x86_64-linux-gnu/libGL.so -DOPENGL_glu_LIBRARY=/usr/lib/x86_64-linux-gnu/libGLU.so ..cmake -DCMAKE_BUILD_TYPE=Release -DOPENGL_gl_LIBRARY=/usr/lib/x86_64-linux-gnu/libGL.so ..
这样就可以cmake过了,后续跟其他文章差不多
在Ubuntu 18.04上下载并安装基于QT的PCL 1.13和VTK 8.2,以及如何卸载它们 - 小蓝博客
记得如果安装其他包也需要opengl,也要指定下路径即可,比如pcl