Qt application on Windows not starting

When you click on an applications exe file and nothing happens, you might wonder what it does (if anything) and find a way to debug what is happening. By default, the binary does not output any log to the console. But there is a way to do that.

You can rebuild your Qt app using the console qmake flag in order to get some useful debugging output on the console.

CONFIG += console

either in your QtCreator Build Settings or as a command line argument to qmake. Then run the app exe from a Windows terminal such as PowerShell and you will see the same output you would see in QtCreator, including your qDebug outputs. You can also click on it in the explorer and it opens a standard terminal showing the console output.

This can be very useful, e.g. when debugging a sandbox created with windeployqt.