在Red Hat Linux中的g ++ 4.4.7上编译C ++ 11 [英] Compiling C++11 on g++ 4.4.7 in Red Hat linux
本文介绍了在Red Hat Linux中的g ++ 4.4.7上编译C ++ 11的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经尝试过:
g++ -std=c++11 my_file.cpp -o my_prog
g++ -std=c++0x ...
g++ -std=gnu++0x ...
,而我一直收到此消息:
and I keep getting this message:
error: unrecognized command line option
推荐答案
从那里您可以看到C ++ 11是自gcc 4.7和gcc 4.4支持C ++ 0x以来受支持。
From there you can see that C++11 is supported since gcc 4.7 and gcc 4.4 has C++0x support.
GCC提供对即将推出的ISO C ++标准
C ++ 0x的实验性支持。可以使用-std = c ++ 0x或-std = gnu ++ 0x
编译器选项启用此支持;前者禁用GNU扩展。
GCC provides experimental support for the upcoming ISO C++ standard, C++0x. This support can be enabled with the -std=c++0x or -std=gnu++0x compiler options; the former disables GNU extensions.
因此它应与 -std = c ++ 0x $一起使用c $ c>或
-std = gnu ++ 0x
。
这篇关于在Red Hat Linux中的g ++ 4.4.7上编译C ++ 11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文