Are all official Qt binaries built with -no exceptions?

If i write

try {
    throw std::exception("Exception");
} catch (std::exception& ex) {
    qDebug("Game Over");
}

inside my main function (or somewhere else), my Qt application crashes. This effect was described (5 years ago) in Exception Handling Doesn't Work with Qt on Windows .

The original poster apparently solved the problem by reconfiguring and restoring itself in the Qt SDK (obviously favorable -exceptions), but it’s hard for me to believe that all Qt executables come with exceptions turned off and that everyone should do it with an exception.

Can someone point me to the place where this is documented, tell me if this is really at all or what am I doing wrong here?

I am now on Qt 5.4.2 with MSVC2013, Win 7 (downloaded quartet-open-source-Windows-x86-msvc2013_opengl-5.4.2.exe from here ).

+4
source share
1 answer

You are not doing anything wrong. Since Qt does not use exceptions, unnecessary overhead would be to include them in the standard Qt builds by default. Therefore, on platforms that allow exceptions to be disabled, they are actually disabled.

In general, you really need to build Qt yourself. Pre-created binaries are great for students to research and use, but if you are serious about using it in your product or you need a custom configuration, you absolutely need to compile it with the necessary flags.

+3
source

All Articles