问题描述
在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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!