概述
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
在.pro中添加
QMAKE_CXXFLAGS += -std=c++11
最后
以上就是雪白蚂蚁为你收集整理的c++0x_warning.h 错误的全部内容,希望文章能够帮你解决c++0x_warning.h 错误所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复