ISO C ++ 2011标准的编译器和库支持 [英] Compiler and library support for the ISO C++ 2011 standard

查看:428
本文介绍了ISO C ++ 2011标准的编译器和库支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用带有rpi-hw库的Qt创建器在raspbery Pi(debian wheezy)中创建i2c通信。我在linux系统中成功编译并安装了rpi-hw库。但是当我试图把它包含在我的Qt中时。出现以下错误。



/usr/include/c++/4.7/bits/c++0x_warning.h:32:错误:#error此文件需要编译器和库支持ISO C ++ 2011标准。此支持目前是实验性的,必须使用-std = c ++ 11或-std = gnu ++ 11编译器选项启用。

/usr/include/rpi-hw.hpp:159 :在/usr/include/rpi-hw.hpp:159:0中包含的文件中,

/home/pi/untitled/main.cpp:2:来自../untitled/main.cpp :2:

/usr/include/rpi-hw/types.hpp:32:错误:'std :: int8_t'尚未宣布

/ usr / include /rpi-hw/types.hpp:33:错误:'std :: int16_t'尚未宣布

/usr/include/rpi-hw/types.hpp:34:错误:'std :: int32_t'尚未宣布

/usr/include/rpi-hw/types.hpp:35:错误:'std :: int64_t'尚未宣布

/usr/include/rpi-hw/types.hpp:37:错误:'std :: uint8_t'尚未宣布





任何人都知道如何在我的Qt创建者中解决这个问题。我试图在Projects-> Build Steps->中添加-std = gnu ++ 11。其他参数但没有运气



请帮助。

I am trying to create an i2c communication in raspbery Pi(debian wheezy) using Qt creator with rpi-hw library. I successfully compiled and installed the rpi-hw library in my linux system. But when I try to include this in my Qt. Got the following errors.

/usr/include/c++/4.7/bits/c++0x_warning.h:32: 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.
/usr/include/rpi-hw.hpp:159: In file included from /usr/include/rpi-hw.hpp:159:0,
/home/pi/untitled/main.cpp:2: from ../untitled/main.cpp:2:
/usr/include/rpi-hw/types.hpp:32: error: 'std::int8_t' has not been declared
/usr/include/rpi-hw/types.hpp:33: error: 'std::int16_t' has not been declared
/usr/include/rpi-hw/types.hpp:34: error: 'std::int32_t' has not been declared
/usr/include/rpi-hw/types.hpp:35: error: 'std::int64_t' has not been declared
/usr/include/rpi-hw/types.hpp:37: error: 'std::uint8_t' has not been declared


Any one know how to fix this in my Qt creator. I tried to add -std=gnu++11 in Projects->Build Steps-> Additional arguments but no luck

Please help.

推荐答案

我在PRO文件中使用以下内容< br $>




I use the following in my PRO files


Quote:

QMAKE_CXXFLAGS + = -std = c ++ 0x

QMAKE_CXXFLAGS += -std=c++0x





确定编译器需要哪些标志(看起来你的错误信息有两个建议)。



Determine which flags are required by your compiler (and it looks like your error message makes two suggestions).


这篇关于ISO C ++ 2011标准的编译器和库支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆