您的位置:首页 > 编程语言 > C语言/C++

c++0x_warning.h:31:2: error

2014-05-06 15:24 302 查看
g++编译使用libmemcached编写的程序时报错,做个简单的记录。

In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/cinttypes:35,

from /usr/include/libmemcached-1.0/memcached.h:46,

from /usr/include/libmemcached/memcached.h:39,

from main.cpp:4:

/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.

解决方法:

makefile之前的写法是: CXX = g++

CXXFLAG = -g -Wall

在flag里加上-std=c++0x就可以编译通过啦,即:

CXX = g++

CXXFLAG = -g -Wall -std=c++0x
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐