当前位置: 代码迷 >> 综合 >> 「 Linux调试错误 」Sophus/sophus/so2.cpp:33:26:error: lvalue required as left operand of assignment
  详细解决方案

「 Linux调试错误 」Sophus/sophus/so2.cpp:33:26:error: lvalue required as left operand of assignment

热度:84   发布时间:2023-12-15 10:34:08.0

一、问题描述

        安装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.); }

*亲测有效

  相关解决方案