gaoxiang12 / slambook2

edition 2 of the slambook
MIT License
5.44k stars 2.01k forks source link

关于CH3编译错误问题 #24

Open RUNSONGchen opened 5 years ago

RUNSONGchen commented 5 years ago

在ch3中建立build文件并对其进行cmake和make,make后出错如下: error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

error This file requires compiler and library support \

我在CMAKESETListe.txt添加了( CMAKE_CXX_FLAGS "-std=c++11 -O3"),重新创建build和编译仍出现错误

gaoxiang12 commented 4 years ago

解决了吗?

RUNSONGchen commented 4 years ago

没有,现在转window调试,望帮助

---原始邮件--- 发件人: "Xiang Gao"<notifications@github.com> 发送时间: 2019年10月15日(星期二) 上午9:36 收件人: "gaoxiang12/slambook2"<slambook2@noreply.github.com>; 抄送: "Author"<author@noreply.github.com>;"RUNSONGchen"<2272425361@qq.com>; 主题: Re: [gaoxiang12/slambook2] 关于CH3编译错误问题 (#24)

解决了吗?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

bittergourd1224 commented 4 years ago

我遇到了一样的问题,参考你的思路搜索了一下,我这边可以解决了。我是在CMAKESETListe.txt添加了: set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

bittergourd1224 commented 4 years ago

我这个方法到CH4中又不管用了,目前还没找到解决的办法

dwindy commented 4 years ago

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

thanks

bittergourd1224 commented 4 years ago

我这个方法到CH4中又不管用了,目前还没找到解决的办法

最近终于解决了这个,但因为尝试的方法太多,已经不确定究竟哪步起了作用。主要建议有:

  1. sophus版本尽量与作者的一致。因为现在的sophus编译时要求eigen3在3.3版本以上,可能会出现问题。
  2. 在CMAKESETListe.txt添加 set(CMAKE_CXX_FLAGS "-std=c++11 -O2")
lldavuull commented 4 years ago

謝謝樓上,在 CMAKESETListe.txt添加 set(CMAKE_CXX_FLAGS "-std=c++11 -O2") 後 解決了編譯ch3/examples的問題。