我在安装 opencv 时遇到了很多问题,在此过程中我不小心删除了/usr/include。我怎样才能以正确的方式恢复它们,以便当我尝试 catkin_make 我的 ros 工作区时不会发生以下错误?
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Error at /opt/ros/noetic/share/cv_bridge/cmake/cv_bridgeConfig.cmake:113 (message):
Project 'cv_bridge' specifies '/usr/include/opencv4' as an include dir,
which is not found. It does neither exist as an absolute directory nor in
'${{prefix}}//usr/include/opencv4'. Check the issue tracker
'https://github.com/ros-perception/vision_opencv/issues' and consider
creating a ticket if the problem has not been reported yet.
Call Stack (most recent call first):
/opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
LeGO-LOAM/LeGO-LOAM/CMakeLists.txt:8 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/lukas/workspace/catkin_ws_legoloam/build/CMakeFiles/CMakeOutput.log".
See also "/home/lukas/workspace/catkin_ws_legoloam/build/CMakeFiles/CMakeError.log".
make: *** [Makefile:320: cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
由于我保留了成功安装后剩下的文件夹,是否可以将文件夹从 /usr/local/include 复制到 /usr/include ?这是否会导致问题?
答案1
您只需使用 APT 的功能即可恢复/usr/include
文件夹内容:
sudo apt-get install --reinstall \
$(dpkg -S /usr/include/ | sed "s/,//g" | sed "s|: /usr/include||")
该/usr/local/include
文件夹不受 APT 控制,因此无法使用上述命令恢复。