gcc不支持long long啊?怎么会。。。

软件和网站开发以及相关技术探讨
回复
头像
gongzhitaao
帖子: 2
注册时间: 2008-08-15 14:44

gcc不支持long long啊?怎么会。。。

#1

帖子 gongzhitaao » 2009-02-06 16:29

main.cpp|7|error: ISO C++ 1998 does not support ‘long long’
怎么C++的标准还是1998年的。。。怎么升级这个标准啊。。。
ubuntu8.10。。。
我用的IDE是codeblocks :em20
poet
帖子: 2841
注册时间: 2006-09-11 22:47

Re: gcc不支持long long啊?怎么会。。。

#2

帖子 poet » 2009-02-06 16:46

自己回去看看标准去。

C++确实不支持 long long

long long 是 C99 委员会在 1999 年制定的。要想支持long long 必须使用 C,C++不行。

另外告诉楼主:
最新的C++标准就是1998年的,下一个标准据说准备2010年出,不过我看悬。
最新的C标准就是1999年的,下一个标准暂时还没有定具体什么时间。
sarrow
帖子: 403
注册时间: 2007-10-27 1:04

Re: gcc不支持long long啊?怎么会。。。

#3

帖子 sarrow » 2009-02-10 10:13

最新的C++标准就是1998年的,
不知道那个ISO C++ 2003 在楼上的眼里算个什么东西。
dbzhang800
帖子: 3182
注册时间: 2006-03-10 15:10
来自: xi'an China
联系:

Re: gcc不支持long long啊?怎么会。。。

#4

帖子 dbzhang800 » 2009-02-10 12:43

一般说来现在的标准为ISO/IEC 14882:1998,称为C++98。ISO/IEC 14882:2003是对98标准的补充和修正,也可认为是C++98的03 fix。现在正在制定C++0x的标准,预计于200x年通过成为新标准。(现在看只可能x为9,即C++09标准,不然要改成C++1x了 ^_^)。

GCC 支持ISO C++ 1998,并对将到来的的 ISO C++ 200x 提供实验性支持。

GCC 对 ISO C++ 2003 没有专门的选项,选项 -ansi 或-std=c++98 已启用对 2003 的支持

选项 -std=c++0x 提供对下一个标准的实验支持(其中有楼主关心的c99引入的 long long)

GCC 网站上对 C++ 标准部分是这么描述的:
GCC supports the ISO C++ standard (1998) and contains experimental support for the upcoming ISO C++ standard (200x).

The original ISO C++ standard was published as the ISO standard (ISO/IEC 14882:1998) and amended by a Technical Corrigenda published in 2003 (ISO/IEC 14882:2003). These standards are referred to as C++98 and C++03, respectively. GCC implements the majority of C++98 (export is a notable exception) and most of the changes in C++03. To select this standard in GCC, use one of the options -ansi or -std=c++98; to obtain all the diagnostics required by the standard, you should also specify -pedantic (or -pedantic-errors if you want them to be errors rather than warnings).

The ISO C++ committee is working on a new ISO C++ standard, dubbed C++0x, that is intended to be published by 2009. C++0x contains several changes to the C++ language, some of which have been implemented in an experimental C++0x mode in GCC. The C++0x mode in GCC tracks the draft working paper for the C++0x standard; the latest working paper is available on the ISO C++ committee's web site at http://www.open-std.org/jtc1/sc22/wg21/. For information regarding the C++0x features available in the experimental C++0x mode, see http://gcc.gnu.org/gcc-4.3/cxx0x_status.html. To select this standard in GCC, use the option -std=c++0x; to obtain all the diagnostics required by the standard, you should also specify -pedantic (or -pedantic-errors if you want them to be errors rather than warnings).

By default, GCC provides some extensions to the C++ language; See Options Controlling C++ Dialect. Use of the -std option listed above will disable these extensions. You may also select an extended version of the C++ language explicitly with -std=gnu++98 (for C++98 with GNU extensions) or -std=gnu++0x (for C++0x with GNU extensions). The default, if no C++ language dialect options are given, is -std=gnu++98.
lfs09
帖子: 69
注册时间: 2008-04-24 9:20

Re: gcc不支持long long啊?怎么会。。。

#5

帖子 lfs09 » 2009-02-26 9:38

请问怎么才能让/usr/include/asm/下面有io.h这个文件啊
回复