How to prevent qmake from adding the console subsystem on the linker command line?

qmake is putting both /SUBSYSTEM:CONSOLE and /SUBSYSTEM:WINDOWS on the linker command line. This is in spite of having CONFIG += windows and CONFIG -= console present in the project file. This is with Qt 5.1.1, app template, otherwise default settings. The mkscpec is win32-msvc2012. I'm using the widgets and testlib subsystems.

How do I get rid of the CONSOLE subsystem?

Upvotes: 4

Views: 2166

Answers (1)

In Qt 5 using testlib module adds a console option via the MODULE_CONFIG mechanism. This forces a /SUBSYSTEM: CONSOLE onto the linker command line no matter what global options you specify, even if you use CONFIG -= console.

The console configuration is given in the testlib module configuration within qtbase/src/testlib/testlib.pro. This means that it ends up in QT.testlib.CONFIG variable. It's easily removable if you want to use testlib without forcing the console subsystem. In your project file, add

QT.testlib.CONFIG -= console

Upvotes: 4

Related Questions