Qt编译报错error: exception handling disabled, use -fexceptions to enable的解决方法

如题,在Qt中使用了C++标准库中的异常处理机制,即try catch语句,在编译时报错error: exception handling disabled, use -fexceptions to enable catch(std::exception excp)

解决方法:在Qt的工程文件中添加  CONFIG += exceptions或者CONFIG -= exceptions_off,然后再重新编译就可以了。

更加详细的说明请参考https://www.cnblogs.com/findumars/p/4898360.html。

posted @ 2023-06-11 14:10  许卡文迪  阅读(174)  评论(0编辑  收藏  举报