作者photon3108 (John)
看板C_and_CPP
标题Re: [问题] gcc -std=c++98 的 error
时间Fri Apr 10 13:19:31 2009
:
※ 发信站: 批踢踢实业坊(ptt.cc)
: ◆ From: 118.161.187.43
: 推 legendmtg:你要提醒自己啥? 04/09 16:40
: → legendmtg:mingw对宽字元没有支援 04/09 16:41
: → photon3108:提醒是否有符合 standard c++ 的规则;程式内容里面, 04/09 17:13
: → photon3108:我没有使用宽字元 <--- 很怪吧,我也很疑惑,哈。 04/09 17:14
: → tinlans:try -std=gnu++98 04/09 18:28
: → tinlans:那两个 function 是 C99,ISO C++ 98 的年代看不见未来。 04/09 18:29
: 推 Bencrie:http://gcc.gnu.org/gcc-4.3/cxx0x_status.html 04/09 23:20
: → Bencrie:试看看 -std=c++0x 04/09 23:21
一、程式内容
相同
二、测试 -std=gnu++98 (to tinlans: thanks)
0 errors 太棒了。
我查了 gcc 4.3.3 的官方文件,是这麽形容的:
`gnu++98'
GNU dialect of -std=c++98. This is the default for C++ code.
其实我有点不了解的是,这个选项可以做到:
(standard c++ 的版本是 98 or later)
a. 符合 standard c++ 的功能,都可以使用。
b. 不符合 standard c++ 的功能,都不允许编译通过。
可以做到吗?
另外,有一个疑问是,程式内容没有使用宽字元,也没有使用这两个 functions,
(所以应该也没有使用到 C99),为什麽会跳出这些 errors?,这个问题只有我遇
到吗?,如果是的话,是不是我的电脑有问题。
三、测试 -std=c++0x (to Bencrie: thanks)
编译没有通过,同样是那两个 errors。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.161.204.129