在Eclipse CDT(Juno / Kepler / Luna)索引器中启用C ++ 11 [英] Enable C++11 in Eclipse CDT (Juno/Kepler/Luna) indexer
问题描述
如何在Juno / Kepler / Luna中的Eclipse CDT索引器上启用对新C ++标准的支持?
注意,此问题(和答案)仅涉及在编译之前用于突出显示错误的 Eclipse索引器。 C ++编译器设置未更改!(因此,编译可能会失败,因为缺少C ++ 11设置,但请查看相关部分)
要更改 Eclipse索引器设置,请转到
项目属性
- > C / C ++ c> - >
- >
预处理器包括路径,宏等
- > > CDT GCC内置编译器设置
并附加 -std = c ++ 0x
(或 -std = c ++ 11
)到命令以获取编译器规格:
之后它应该像:
$ {COMMAND} E -P -v -dD $ {INPUTS} -std = c ++ 0x
源 / p>
- 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 li>
相关
- Eclipse CDT C ++ 11 / C ++ 0x支持
- https://stackoverflow.com/a/17499266/760746 (C ++ 11 - 启用编译器(Kepler及之前版本))
- https://stackoverflow.com/a/22480299/760746 (C ++ 11 - 启用编译器(Kepler(已更新)和更新版本)
更新
使用Eclipse成功测试
- Kepler(CDT 8.2)
- Luna(CDT 8.4)
How do I enable support for the new C++ standard on the Eclipse CDT indexer in Juno/Kepler/Luna?
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)
这篇关于在Eclipse CDT(Juno / Kepler / Luna)索引器中启用C ++ 11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!