紧急 使用unordered_map错误

sinat_28720171 2016-05-04 11:43:03
问题描述

包含头文件#include <unordered_map>后编译器报错,错误信息为:

This file requires compiler and library support for the \ISO C++ 2011 standard. This support is currently experimental, and must be \enabled with the -std=c++11 or -std=gnu++11 compiler options.

该错误来自文件:c++0x_warning.h中的

#ifndef _CXX0X_WARNING_H
#define _CXX0X_WARNING_H 1

#if __cplusplus < 201103L
#error This file requires compiler and library support for the \
ISO C++ 2011 standard. This support is currently experimental, and must be \
enabled with the -std=c++11 or -std=gnu++11 compiler options.
#endif

#endif

求解决方案,谢谢!
...全文
1216 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
QLU_minoz 2018-07-29
  • 打赏
  • 举报
回复
头文件加上
#include <tr1/unordered_map>

命名空间加上
using namespace std::tr1;

这样
#include <iostream>
#include <tr1/unordered_map>

using namespace std;
using namespace std::tr1;
赵4老师 2016-05-04
  • 打赏
  • 举报
回复
编译命令行加-std=c++11

3,881

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧