我需要在网络模拟器NS-3的代码中使用像unordered_map这样的数据结构.它使用waf builder来编译源代码.我很困惑,我应该在哪里添加-std = c ++ 0x添加到编译器标志?我尝试使用以下命令将其附加到主wscript文件中的CXXFlags:
module.env.append_value('CXXFLAGS', '-std=c++0x');
Run Code Online (Sandbox Code Playgroud)
但我仍然收到此错误:
此文件需要编译器和库支持即将推出的ISO C++标准C++ 0x.此支持目前是实验性的,必须使用-std = c ++ 0x或-std = gnu ++ 0x编译器选项启用.C/C++问题
我是否还应该将任何库添加到我的waf模块中?
PS:我的GCC版本是4.4
更新:更新到4.7后,我收到此错误:
error: #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.
Run Code Online (Sandbox Code Playgroud)
有没有办法告诉编译器使用0x而不是11?