Eclipse CDT的索引不知道C ++ 11容器 [英] Eclipse CDT indexer does not know C++11 containers

查看:598
本文介绍了Eclipse CDT的索引不知道C ++ 11容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在配置Eclipse CDT的一个C ++ 11的项目来使用gcc-4.7。这不是我的系统,它不支持C ++ 11的默认编译器。为了编纂工作,我需要通过标志 -std = C ++ 11 键,还包括下面的头道:的/ usr /本地/库/ GCC / 4.7.2 / GCC /有/ 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_map 中,每当我使用C ++ 11的容器类型,如的std :: unordered_set 或CDT索引抱怨:符号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?

推荐答案

在本论坛的帖子描述:

<一个href=\"http://www.eclipse.org/forums/index.php/mv/msg/282618/\">http://www.eclipse.org/forums/index.php/mv/msg/282618/


  • 右键单击该项目并进入属性C / C ++常规 - >路径
    和符号 - >符号 - > GNU C ++

  • 单击添加...并粘贴 __ __ GXX_EXPERIMENTAL_CXX0X 成名和
    离开值的空白。点击应用,尽一切可能让你去做,然后
    点击OK。

这篇关于Eclipse CDT的索引不知道C ++ 11容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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