且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Eclipse / Nsight(7.0)和C ++ 11支持

更新时间:2022-05-01 23:00:47

在使用本机编译器时,我遇到了与索引器类似的问题;但是,交叉编译器工作正常。当使用本地编译器时,即使C ++方言已经设置为C ++ 11并且重建索引, __ cplusplus 也被定义为199711L。

I experienced a similar problem with the indexer when using the native compiler; however, the cross compiler worked correctly. When using the native compiler, __cplusplus was defined as 199711L even though the C++ dialect had been set to C++11 and the index rebuilt.

索引器可以通过转到

项目设置 - > C / C ++ General-> Preprocessor Include Paths来获取C ++ 11设置,宏等等 - >提供程序 - > CDT GCC内置编译器设置

Project Settings->C/C++ General->Preprocessor Include Paths, Macros etc.->Providers->CDT GCC Built-in Compiler Settings

并执行:


  1. 取消选中使用项目之间共享的全局提供程序

  2. 添加 -std = c ++ 11 命令获取编译器规格

$ {COMMAND} -std = c ++ 11 $ {FLAGS} ...

__cplusplus 现在应该正确设置。