Exception Handling doesn't work

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 05:51:04

问题


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?


回答1:


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

options
{
    enable-exceptions=1
}

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.



来源:https://stackoverflow.com/questions/10732418/exception-handling-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!