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过了,后续跟其他文章差不多
编译pcl库
一般人直接cmake .. 就行
cmake -DOPENGL_gl_LIBRARY=/usr/local/cuda-12.2/nsight-compute-2023.2.0/host/linux-desktop-glibc_2_11_3-x64/Mesa/libGL.so ..
别人的命令,参考
cd ~
git clone https://github.com/PointCloudLibrary/pcl.git
cd pcl
git checkout pcl-1.13.0
mkdir build && cd build
cmake ..
make -j$(nproc)
sudo make install
如果出现了链接问题
找不到vtkMutexLock.h
vtk安装9.2.0
【踩坑记录】ubuntu20.04源码编译安装最新版PCL1.13.0踩坑记录之vtkMutexLock.h找不到_ubuntu20.04 安装pcl1.13-CSDN博客
参考文章: