Eclipse CDT 索引器不知道 C++11 容器 [英] Eclipse CDT indexer does not know C++11 containers
问题描述
我在 Eclipse CDT 中配置了一个 C++11 项目以使用 gcc-4.7.它不是我系统上的默认编译器,它不支持 C++11.为了使编译工作,我需要传递标志 -std=c++11
并包含以下头文件路径:/usr/local/Cellar/gcc/4.7.2/gcc/include/c++/4.7.2
I configured a C++11 project in Eclipse CDT to use gcc-4.7. It is not the default compiler on my system, which does not support C++11. In order for compilation to work, I need to pass the flag -std=c++11
and also include the following header path: /usr/local/Cellar/gcc/4.7.2/gcc/include/c++/4.7.2
每当我使用像 std::unordered_set
或 std::unordered_map
这样的 C++11 容器类型时,CDT 索引器都会抱怨:Symbol unordered_set 不能已解决
.如何告诉索引器正确解析这些符号?
Whenever I use C++11 container types like std::unordered_set
or std::unordered_map
, the CDT indexer complains: Symbol unordered_set could not be resolved
. How can I tell the indexer to resolve these symbols correctly?
这是我配置索引器的方式:
This is how I have configured my indexer:
据我了解设置,索引器应该使用当前活动构建配置中的编译器设置.编译工作正常,那么为什么索引也不行?
As far as I understand the settings, the indexer is supposed to use the compiler settings from the currently active build configuration. Compilation works fine, so why doesn't indexing, too?
推荐答案
如本论坛帖子所述:
http://www.eclipse.org/forums/index.php/mv/msg/282618/
- 右键单击项目并转到属性"C/C++ General -> Paths和符号 -> 符号 -> GNU C++.
- 点击添加..."并将
__GXX_EXPERIMENTAL_CXX0X__
粘贴到名称"中,然后将值"留空.点击应用,做任何它要求你做的事情,然后点击确定.
这篇关于Eclipse CDT 索引器不知道 C++11 容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!