一、问题描述
安装Sophus库时,cmake通过,在make时,发生错误。提示错误如下:
1. Sophus/sophus/so2.cpp:33:26:error: lvalue required as left operand of assignment
unit_complex_.real() = 1.;
2. Sophus/sophus/so2.cpp:33:26:error: lvalue required as left operand of assignment
unit_complex_.imag() = 1.;*
二、解决方法
打开 Sophus/sophus/so2.cpp文件。
将:
SO2::SO2()
{ unit_complex_.real() = 1.; unit_complex_.imag() = 0.; }
改成:
SO2::SO2()
{ unit_complex_.real(1.); unit_complex_.imag(0.); }
*亲测有效