简体   繁体   中英

Add /EHa to QtCreator that used Microsoft Visual C++ Compiler

How can I add /EHa (Structured Exception Handling) in QtCreator for MS Compiler. I've been used Microsoft Visual C++ Compiler.

This is how to do it. Works both for Qt 4 and Qt 5. This will set EHa instead of default EHsc:

win* {
   QMAKE_CXXFLAGS_EXCEPTIONS_ON = /EHa
   QMAKE_CXXFLAGS_STL_ON = /EHa
}

在项目文件中,添加:

QMAKE_CXXFLAGS += /EHa

Just go to the QtDIR and mkspecs and choose folder of compiler

and then open qmake.conf and edit

QMAKE_CFLAGS_RELEASE to 

QMAKE_CFLAGS_RELEASE = -EHA

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM