日期:2014-05-16  浏览次数:20879 次

问一个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支持。