[Qt-interest] Supressing console

Juan D Guzman lostinthecode at googlemail.com
Tue Mar 10 14:31:15 CET 2009


Daniel Franke wrote:
> On Tuesday 10 March 2009 13:52:41 Juan D Guzman wrote:
>   
>> Ok here's a simple one for you that is stumping me.  In VS my app
>> compiles and runs fine without showing in console.  However, in Qt
>> Creator when I run the app it shows a console.  All the preprocessor
>> defs are the same and no matter what I try I can't get rid of the
>> console. Any ideas?
>>     
>
> Add 'CONFIG += windows' in your .pro file.
>
> http://doc.trolltech.com/4.5/qmake-variable-reference.html#config
>
> "windows  The target is a Win32 window application (app only). The proper 
> include paths, compiler flags and libraries will automatically be added to 
> the project."
>
> Cheers
>
> 	Daniel
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>   
Unfortunately that didn't work either. Adding CONFIG =+ windows adds the 
windows subsystem to the linker but it doesn't remove the console as 
seen below.

link /LIBPATH:"c:\Qt\shared_4.5.0\lib" /NOLOGO /DEBUG /SUBSYSTEM:WINDOWS 
"/MANIFESTDEPENDENCY:type='win32' 
name='Microsoft.Windows.Common-Controls' version='6.0.0.0' 
publicKeyToken='6595b64144ccf1df' language='*' 
processorArchitecture='*'" /MANIFEST 
/MANIFESTFILE:"debug\CuClient.intermediate.manifest" /SUBSYSTEM:CONSOLE 
/OUT:..\qtbin\win32_debug\CuClient.exe 
@C:\Users\JD\AppData\Local\Temp\nm7A06.tmp

Adding CONFIG -= console to the pro file didn't remove and I even tried 
by adding it under project settings and still to no avail.

It seems that the problem is that since the last call is to 
subsystem:console that is what the linker does.

Cheers,

JD



More information about the Qt-interest-old mailing list