You do not turn off exceptions by setting QMAKE_CXXFLAGSbecause these parameters are processed CONFIG. You have to use
CONFIG-=exceptions
to disable them.
See g ++ arguments if you have neither settings QMAKE_CXXFLAGSnor CONFIG:
g++ -c -O2 -frtti -fexceptions -mthreads -Wall <...> main.cpp
Now install set QMAKE_CXXFLAGS: get
g++ -c -fno-exceptions -O2 -frtti -fexceptions -mthreads -Wall <...> main.cpp
Oooh, we get our -fno-exceptionsredefined CONFIG -fexceptions. Now let set CONFIG:
g++ -c -O2 -frtti -Wall -fno-exceptions <...> main.cpp
mingw32-make.exe[1]: Leaving directory `G:/proj/ingeritance'
main.cpp: In function 'int qMain(int, char**)':
main.cpp:22:15: error: exception handling disabled, use -fexceptions to enable
mingw32-make.exe[1]: *** [release/main.o] Error 1
mingw32-make.exe: *** [release] Error 2
ABOUT! compilation error!
source
share