Sophus库是一个李群李代数库
正常安装是
mkdir bulid
cd bulid
cmake ..
make
但是报错如下
f assignment
32 | unit_complex_.real() = 1.;
| ^~
/home/liwete/gaoxiang12-slambook/3rdparty/Sophus/sophus/so2.cpp:33:26: error: lvalue required as left operand of assignment
33 | unit_complex_.imag() = 0.;
| ^~
所以进入该文件Sophus/sophus/so2.cpp:32:26
修改为
unit_complex_.real(1.);
unit_complex_.imag(0.);
而后注意我们的cmakelist,一定要加上set(CMAKE_BUILD_TYPE "Release")
cmake_minimum_required( VERSION 2.8 )
project( useSophus )
set(CMAKE_BUILD_TYPE "Release")
# 为使用 sophus,您需要使用find_package命令找到它
find_package( Sophus REQUIRED )
include_directories( ${Sophus_INCLUDE_DIRS} )
add_executable( useSophus useSophus.cpp )
target_link_libraries( useSophus ${Sophus_LIBRARIES} )