Enable C++11 in Eclipse CDT (Juno/Kepler/Luna) indexer [duplicate]

点点圈 提交于 2019-12-17 02:11:43

问题


How do I enable support for the new C++ standard on the Eclipse CDT indexer in Juno/Kepler/Luna?


回答1:


Note that this question (and answer) only deals with the Eclipse indexer which is used to highlight errors before compilation takes place. The C++ compiler settings are not changed! (Thus, compilation could still fail because of missing C++11 settings, but have a look at the "Related" section)

To change the Eclipse indexer settings go to Project properties -> C/C++ General -> Preprocessor Include Paths, Macros etc. -> tab Providers -> CDT GCC Built-in Compiler Settings

and append -std=c++0x (or -std=c++11) to Command to get compiler specs:

Afterwards it should look something like:

${COMMAND} -E -P -v -dD ${INPUTS} -std=c++0x

Sources

  • http://wiki.eclipse.org/CDT/User/FAQ#CDT_does_not_recognize_C.2B.2B11_features
  • http://www.eclipse.org/forums/index.php/mv/msg/373462/909018/#msg_909018

Related

  • Eclipse CDT C++11/C++0x support
  • https://stackoverflow.com/a/17499266/760746 (C++11-enable the compiler (Kepler and before))
  • https://stackoverflow.com/a/22480299/760746 (C++11-enable the compiler (Kepler (updated) and newer)

Update

Successfully tested with Eclipse

  • Kepler (CDT 8.2)
  • Luna (CDT 8.4)


来源:https://stackoverflow.com/questions/13635079/enable-c11-in-eclipse-cdt-juno-kepler-luna-indexer

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