Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

qt

qt5

qmake

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?

like image 955
Kuba hasn't forgotten Monica Avatar asked Oct 12 '25 13:10

Kuba hasn't forgotten Monica


1 Answers

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
like image 70
Kuba hasn't forgotten Monica Avatar answered Oct 14 '25 21:10

Kuba hasn't forgotten Monica