Sophus安装过程如下:
git clone https://github.com/strasdat/Sophus.git
下载完成后
cd Sophus git checkout a621ff mkdir build cd build cmake .. make sudo make install
Sophus库的使用,为了编译他,请在cmake工程中的CMakeLists.txt文件中添加以下内容
# 寻找Sophus库
find_package( Sophus REQUIRED )
# 添加头文件路径
include_directories( ${Sophus_INCLUDE_DIRS} )
add_executable( xxx xxx.cpp)
#链接库
target_link_libraries( xxx ${Sophus_LIBRARIES}
在使用过程中,遇到了这样的问题
这个问题的的主要原因是
target_link_libraries( main ${Sophus_LIBRARIES} )
main处应该是项目名称
更改后,可运行