【问题标题】:Couldn't use std::unordered_map in my code无法在我的代码中使用 std::unordered_map
【发布时间】:2013-03-17 03:29:48
【问题描述】:

我无法在我的代码中使用 std::unordered_map,但它可以与 std::tr1::unordered_map 一起使用。这是一个已知问题吗?如果我想改用 std::unordered_map 该怎么办? 操作系统:ubuntu IDE:日食CDT 海湾合作委员会:4.7.2 编译器选项:--std=c++11

这会引发错误 - 无法解析符号“unordered_map”:

    std::unordered_map<unsigned int, std::vector<test> > m;

【问题讨论】:

标签: c++ c++11 eclipse-cdt


【解决方案1】:

缺少符号通常表明包含了错误的标题。确保从

更改包含的标题
#include <tr1/unordered_map> 

#include <unordered_map>

【讨论】:

  • 这是我以前做过的,但我今晚会再检查一遍
猜你喜欢
  • 2020-08-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-07-09
  • 1970-01-01
  • 2021-05-30
相关资源
最近更新 更多