在 Eclipse CDT (Juno/Kepler/Luna) 索引器中启用 C++11
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13635079/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Enable C++11 in Eclipse CDT (Juno/Kepler/Luna) indexer
提问by Nobody
How do I enable support for the new C++ standard on the Eclipse CDT indexer in Juno/Kepler/Luna?
如何在 Juno/Kepler/Luna 中的 Eclipse CDT 索引器上启用对新 C++ 标准的支持?
回答by Nobody
Notethat this question (and answer) only deals with the Eclipse indexerwhich 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)
请注意,此问题(和答案)仅涉及用于在编译之前突出显示错误的Eclipse 索引器。C++ 编译器设置没有改变!(因此,由于缺少 C++11 设置,编译仍然可能失败,但请查看“相关”部分)
To change the Eclipse indexersettings go to
Project properties
-> C/C++ General
-> Preprocessor Include Paths, Macros etc.
-> tab Providers
-> CDT GCC Built-in Compiler Settings
要更改Eclipse 索引器设置,请转到
Project properties
-> C/C++ General
-> Preprocessor Include Paths, Macros etc.
-> 选项卡Providers
->CDT GCC Built-in Compiler Settings
and append -std=c++0x
(or -std=c++11
) to Command to get compiler specs:
并将-std=c++0x
(或-std=c++11
)附加到Command to get compiler specs:
Afterwards it should look something like:
之后它应该看起来像:
${COMMAND} -E -P -v -dD ${INPUTS} -std=c++0x
${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
- 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)
- Eclipse CDT C++11/C++0x 支持
- https://stackoverflow.com/a/17499266/760746(C++11-启用编译器(开普勒及之前))
- https://stackoverflow.com/a/22480299/760746(C++11-enable the compiler (Kepler (updated) and newer)
Update
更新
Successfully tested with Eclipse
使用 Eclipse 成功测试
- Kepler (CDT 8.2)
- Luna (CDT 8.4)
- 开普勒 (CDT 8.2)
- 露娜 (CDT 8.4)