vinnitu
vinnitu

Reputation: 4364

exe with console and gui mode

I compile my qt-project with += console option, I need it to debug version, and for release I rebuild project with -= console

But sometimes I need enable\show console output in release version of my app.

So my question is - Is it possible to pass some argument (line -show_console) to my .exe to start app with console or without (if no option specified)?

Upvotes: 0

Views: 893

Answers (2)

Martin Beckett
Martin Beckett

Reputation: 96109

If you mean you want a gui app that also writes to the console then under windows you need to reopen the console.

Alternatively - Set the application type to console ( ie /subsystem:console in windows) but still write the normal Qt gui code, it will open a console and you can use std::cout

Upvotes: 0

TonyK
TonyK

Reputation: 17114

I have an application with a GUI window and a console window. I open the console window using AllocConsole from the Windows API. The trouble is, Qt can't debug it, at least using gdb, because gdb needs a console too. But see my question here for a workaround.

Upvotes: 1

Related Questions