[英]Compiling with g++, using vector and array libraries
When compiling my cpp file on linux with the following line: 使用以下行在linux上编译我的cpp文件时:
$ g++ -o blabla blabla.cpp
I get the following message on stdout: 我在stdout上收到以下消息:
In file included from
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/array:35,
from blabla.cpp:5: /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../
include/c++/4.4.7/c++0x_warning.h:31:2:
error: #error This file requires compiler and library support for the
upcoming ISO C++ standard, C++0x. This support is currently
experimental, and must be enabled with the -std=c++0x or -std=gnu++0x
compiler options.
The script does #includes
the <vector>
and <array>
libraries, so I don't know why it fails. 该脚本#includes
<vector>
和<array>
库,所以我不知道它为什么会失败。
What causes this error? 是什么导致这个错误?
Above error are coming because you are using the latest feature of C++, and you default version is older than required. 上面的错误即将发生,因为您使用的是C ++的最新功能,并且您的默认版本超过了所需的版本。
Flags (or compiler options) are nothing but ordinary command line arguments passed to the compiler executable. 标志(或编译器选项)只是传递给编译器可执行文件的普通命令行参数。
g++ -std=c++0x -o blabla blabla.cpp
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.