问一个g++的编译错误?

luo6620378xu 2012-03-19 08:11:37
我编译时遇到了如下的错误提示:
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类型。
查看了一下头问发现:

** @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



这里出的编译错误。
但是我在头文件中已经

#define __GXX_EXPERIMENTAL_CXX0X__
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstdint>


请问为什么还是有问题呢?
谢谢!
...全文
1669 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
flyaway 2013-09-07
  • 打赏
  • 举报
回复
楼主,请问在linux环境下如何解决这个问题,是在makefile里面添加什么命令吗》?
luo6620378xu 2012-03-21
  • 打赏
  • 举报
回复
问题已经解决,THX!
youngwolf 2012-03-20
  • 打赏
  • 举报
回复
工程上右键,选择build options,在compiler settings里面,有列表,
选择c++0x支持。
昵称很不好取 2012-03-19
  • 打赏
  • 举报
回复
setting->compiler and debugger setting --> compiler settings -->other options
填入提示的那个选项试试
luo6620378xu 2012-03-19
  • 打赏
  • 举报
回复
我是在codeblocks上编译的。
根据提示需要设置编译选项。
请问如何在codeblocks中设置编译选项?

23,128

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧