Unable to use qDebug() to debug
The application I am working on has a ton of runtime errors/bugs. To remove the errors, and make sure everything is working I added a qDebug() in every significant function.
For example, to follow my signal-slot connections and see if they're working properly.
But I'm not getting any command line output when I run my application. Even for things which I know have happened. For instance, I put qDebug() in the MainWindow's constructor and got no output.
Something like
Code:
MainWindow::MainWindow()
{
...
qDebug()<<"MainWindow constructed.";
...
}
I have included QDebug, and I've re-checked that I'm using the correct syntax. I'm not sure what I'm doing wrong.
Help is greatly appreciated.
Re: Unable to use qDebug() to debug
Check if QT_NO_DEBUG_OUTPUT is defined at compilation time (look to your compile command) or check if there is any use of
Code:
QtMsgHandler qInstallMsgHandler ( QtMsgHandler handler )
Re: Unable to use qDebug() to debug
What platform ? What version are you running, release or debug ?
If its on windows, release version does not have a console output available, you can add CONFIG += console, or run the app under gdb. Debug version should print the messages normally.
Re: Unable to use qDebug() to debug
I'm running Windows. And running debug, not release. I even added CONFIG += console, but then it would not compile.
It gave me this error:
Quote:
undefined reference to WinMain@16
Also, I checked the compile command, and did not see QT_NO_DEBUG_OUTPUT.
Re: Unable to use qDebug() to debug
Have you tried to run your app from cmd line, or gdb ?
Re: Unable to use qDebug() to debug
It worked with gdb. Thank you so much!
Now on to exterminate 'em bugs.