写在前面
自己的测试环境:
Ubuntu20.04
ROS-Noetic
一、问题描述
CMake Error at /***/devel/share/vikit_common/cmake/vikit_commonConfig.cmake:173 (message):
Project 'vikit_ros' tried to find library 'libSophus.so'. The library is
neither a target nor built/installed properly. Did you compile project
'vikit_common'? Did you find_package() it before the subdirectory
containing its code is included?
Call Stack (most recent call first):
/opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
rpg_vikit/vikit_ros/CMakeLists.txt:17 (FIND_PACKAGE)
二、解决方法
出现这个问题的原因可能是由于 Sophus
库的版本不对导致的。这里列出我自己的解决方法供参考。
由于自己当前安装的是Sophus
的模板库 Sophus-1.22.4-template
,才出现的这个报错。所以我这里重新卸载已安装的 Sophus
的模板库。卸载方法参考《make install 安装的库,如何卸载》
然后,下载 Sophus
的非模板库,并安装。
git clone https://github.com/strasdat/Sophus.git
cd Sophus
git checkout a621ff
sudo mkdir build
cd build
cmake ..
make
sudo make install
参考链接
[1] wongHome. make install 安装的库,如何卸载 [EB/OL]. https://blog.csdn.net/qq_39779233/article/details/125123326, 2022-08-19/2024-07-29.
[2] https://github.com/strasdat/Sophus.git