warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify -GX

http://bbs.csdn.net/topics/60195477


这是因为使用了C++异常。/EHsc或/GX,两者是等价的。


exception. It is equivalent to /EHsc.

/GX is in effect, by default, when you compile from within the development environment. By default, /GX- is enabled when using command-line tools.

For more information, see C++ Exception Handling.

To set this compiler option in the Visual Studio development environment 

Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties. 
Click the C/C++ folder. 
Click the Command Line property page. 

Type the compiler option in the Additional Options box. 



http://blog.sina.com.cn/s/blog_5ce0a2540100jyoc.html

#include <iostream.h >是VC6以前的写法。

#include <iostream >
using  namespace  std;

这个是标准库的写法。标准库把这些个文件都放到std这个namespace里面了。

可以到VC\include看看和VC6.0的区别,是iostream而不是iostream.h。

注意 <iostream>和<iostream.h>是两个不同的东西
<iostream>是STL库
<iostream.h>是兼容于c的库
所有STL库都在std::名空间下
std::cout是 <iostream>里面的对象

namespace std: 所有的C++ Standard LibraryClass都包含在这个叫std的name
space里。比如 <vector>,<iostream>,<iterator>等等。所以当你使用它们其中的class时
,需要加入这个语句,using namespace std; 不然编译器报错。


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值