异常处理不工作 [英] Exception Handling doesn't work

查看:241
本文介绍了异常处理不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用 try-catch 块来处理一个除以零例外在marmalade,但我猜测marmalade重写c ++异常处理,所以它不工作。我在论坛上搜索,解决方案似乎是,我必须在mkb中添加一个选项,如帖子

I am trying to use try-catch blocks to handle a divide-by-zero exception in marmalade, but I guess marmalade overrides c++ exception handling, so it's not working. I've searched on the forums and the solution seems to be that I have to add one option in the mkb as explained in this post.

options
{
    enable-exceptions=1
}

我已经尝试添加它,但它不工作。是否有任何方式可以处理这个异常?

I already tried adding it, but it's not working too. Is there any way I can handle this exception?

推荐答案

如果你正在写一个扩展的marmalade异常将无法工作。

If you are writing an extension for the marmalade exceptions will not work. What the

options
{
    enable-exceptions=1
}

是为RVCT添加了一个编译器选项/ GX用于msvc和--exceptions。
所以如果你使用一些其他编译器,如g ++它将无法工作。

does is adds a compiler options /GX for msvc and --exceptions for RVCT. So if you are using some other compiler like g++ it will not work.

这篇关于异常处理不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆