Eclipse/Nsight (7.0) and C++11 support

给你一囗甜甜゛ 提交于 2019-12-06 00:34:27

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.

The indexer can pick up the C++11 settings by going to

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

and doing:

  1. Uncheck Use global provider shared between projects.
  2. Add -std=c++11 to Command to get compiler specs like so:

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

__cplusplus should now be correctly set.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!