当前位置:首页 > 服务端 > [移植"myslam"到zynq上的arm手记] 1

[移植"myslam"到zynq上的arm手记] 1

1. 撸一个 toolchain.cmake

set( CMAKE_SYSTEM_NAME Linux )  
set( CMAKE_SYSTEM_PROCESSOR arm )  
set( CMAKE_C_COMPILER arm-linux-gnueabihf-gcc )  
set( CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++ )  
set( CMAKE_INSTALL_PREFIX /home/albireo/lib_arm/sophus) 

 2. cmake

source /media/albireo/backup/opt/Xilinx/SDK/2017.1/settings64.sh
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake -DCMAKE_INSTALL_PREFIX=/home/albireo/lib_arm/sophus ..

 3. make

报错

cc1plus: error: include location "/usr/include/eigen3" is unsafe for cross-compilation [-Werror=poison-system-directories]
...

/home/albireo/lib/ARM/Sophus/sophus/so2.cpp:32:26: error: lvalue required as left operand of assignment
   unit_complex_.real() = 1.;
                          ^~
/home/albireo/lib/ARM/Sophus/sophus/so2.cpp:33:26: error: lvalue required as left operand of assignment
   unit_complex_.imag() = 0.;
...

cc1plus: all warnings being treated as errors

 4. 神马?warnings being treated as errors?

修改CMakeLists.txt

16行:

ADD_DEFINITIONS("-Wall -Werror -Wno-unused-variable
                   -Wno-unused-but-set-variable -Wno-unknown-pragmas ")

去掉-Werror

5. 修改so2.cpp

SO2::SO2()
{
  unit_complex_= std::complex<double>(1,0);
  // unit_complex_.real() = 1.;
  // unit_complex_.imag() = 0.;
}

如上修改

伊克斯kiu死米?喵喵喵???这什么鬼语法???为啥之前编译能通过的我很好骑

6. make, make install

 

作者:dreamingsheep
来源链接:https://www.cnblogs.com/dreamingsheep/p/8621090.html

版权声明:
1、Java侠(https://www.javaxia.com)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。





本文链接:https://www.javaxia.com/server/125150.html

标签: unused variable
分享给朋友: