Harry Fox
Harry Fox

Reputation: 613

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.

Upvotes: 6

Views: 1607

Answers (3)

Violet Giraffe
Violet Giraffe

Reputation: 33579

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
}

Upvotes: 5

Harry Fox
Harry Fox

Reputation: 613

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

Upvotes: 0

Andy
Andy

Reputation: 176

In your project file, add:

QMAKE_CXXFLAGS += /EHa

Upvotes: 0

Related Questions