首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

问一个g++的编译异常

2012-03-26 
问一个g++的编译错误?我编译时遇到了如下的错误提示:In file included from /usr/include/c++/4.4/cstdint

问一个g++的编译错误?
我编译时遇到了如下的错误提示:
In file included from /usr/include/c++/4.4/cstdint:35,
  from iod_init.h:13:
/usr/include/c++/4.4/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.

因为我在源代码中使用了int64_t类型。
查看了一下头问发现:

C/C++ code
** @file include/c++0x_warning.h *  This is a Standard C++ Library header. */#ifndef _CXX0X_WARNING_H#define _CXX0X_WARNING_H 1#ifndef __GXX_EXPERIMENTAL_CXX0X__#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.#endif#endif


这里出的编译错误。
但是我在头文件中已经
C/C++ code
#define __GXX_EXPERIMENTAL_CXX0X__#include <cstddef>#include <cstdio>#include <cstdlib>#include <cstdint>

请问为什么还是有问题呢?
谢谢!

[解决办法]
setting->compiler and debugger setting --> compiler settings -->other options
填入提示的那个选项试试
[解决办法]
工程上右键,选择build options,在compiler settings里面,有列表,
选择c++0x支持。

热点排行