I've encountered a big surprise for me.
My program doesn't catch any exception (in particully in main function ) when qt libraries have been included.
I googled this problem and didn't find an answer.
Please explain me:
1) Why this happens ?
2) How to bypass this ? I use a combination of libraries in software development (stl, boost, opencv) and i cant develop software, applying ONLY QT.
Details:
QT version - 5.2
Mingw 4.8 and 6.02
.pro file
#-------------------------------------------------
#
# Project created by QtCreator 2018-04-28T23:53:47
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = qt_eception
TEMPLATE = app
SOURCES += main.cpp
HEADERS +=
FORMS +=
#-------------------------------------------------
#
# Project created by QtCreator 2018-04-28T23:53:47
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = qt_eception
TEMPLATE = app
SOURCES += main.cpp
HEADERS +=
FORMS +=
To copy to clipboard, switch view to plain text mode
main.cpp
#include <QApplication>
#undef main
int main(int argc, char *argv[])
{
try
{
throw "ex";
}
catch(...)
{
// Do Nothing
}
return 0;
}
#include <QApplication>
#undef main
int main(int argc, char *argv[])
{
try
{
QApplication a(argc, argv);
throw "ex";
}
catch(...)
{
// Do Nothing
}
return 0;
}
To copy to clipboard, switch view to plain text mode
bug.jpg
Bookmarks