C ++ 11完全支持Eclipse [英] C++11 full support on Eclipse

查看:152
本文介绍了C ++ 11完全支持Eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在Eclipse Juno中,我有很多新功能, __ GXX_EXPERIMENTAL_CXX0X __ 但我没有找到 std :: threads std :: mutex 等。



如何完成所有C ++ 11函数?



EDIT:解决方案



转到 Project - >属性 - > C / C ++ General - >路径和符号 - >标签[Symbols]
201103L 添加 __ cplusplus

解决方案

Eclipse与C + 11支持(Indexer等)很好:Juno和Kepler。事情是,你必须让Eclipse知道你要用C ++ 11支持编译。这是通过向中的 CDT GCC内置编译器设置提供附加标志 -std = c ++ 11 $ c> C / C ++ - >构建 - >设置 - >发现[tab] ,所以它会读取如下:

  $ {COMMAND} -v -dD$ {INPUTS}-std = c ++ 11 

你必须使用Kepler / Juno来获得正确的C ++ 11代码。



注意,这是工作区范围的设置。如果您不想在工作区中设置,您可以对每个项目执行相同操作。


I am trying to find a way to get full C++11 support on Eclipse.

In Eclipse Juno I had a lot of new features with __GXX_EXPERIMENTAL_CXX0X__ but I didn't find support for std::threads, std::mutex, etc.

How can I have completion for all C++11 functions?

EDIT : Solution

Go to Project -> Properties -> C/C++ General -> Path and Symbols -> Tab [Symbols]. Add the symbol : __cplusplus with the value 201103L

解决方案

Eclipse works with C+11 support (Indexer and such) just fine: both Juno and Kepler. The thing is that you have to let Eclipse know that you are going to compile with C++11 support. This is done by providing additional flag -std=c++11 to CDT GCC Builtin Compiler Settings in C/C++ -> Build -> Settings -> Discovery [tab] so it will read something like:

${COMMAND} -E -P -v -dD "${INPUTS}" -std=c++11

And that is all you have to do with Kepler/Juno to get C++11 code highlighted correctly.

Note, this is workspace-wide setting. You can do the same on per project basis if you don't want to set it in workspace.

这篇关于C ++ 11完全支持Eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆