PDA

View Full Version : Debugging in Windows



hardgeus
11th November 2008, 19:34
I have had a bug in my program since August detailed here:

http://www.qtcentre.org/forum/f-qt-programming-2/t-bizarre-bug-with-a-slot-15547.html

I still haven't been able to fix it, and I'm out of ideas. I have been building this project under Linux/gcc and Windows/MingW.

Now I am building in MSVC so I can use the debugger to step through my code, but I can't figure out how to set up the project. I have everything working using nmake, but I have no idea how to get source-level debugging working. Are there any tuturials out there in setting up MSVC projects for debugging QT apps?

SunnySan
12th November 2008, 11:02
you could use the console to send messages
for that add to your .pro this line


win32:CONFIG += console


and use qdebug() inside your code


qDebug() <<"message";


then follow the display in your console while running

Alternatively you could use the debug mode, I tested it under QT-creator it works fine for me (vista + Qt4.4.3 +ming) but I don't know with MS studio.

I hope this help

hardgeus
12th November 2008, 20:40
I had trouble getting it to work in Visual Studio .NET, but I was able to get everything working in the debugger with Visual Studio 6.0

Basically you have to run qmake as follows:

qmake -t vcapp -o myproject.dsp myproject.pro

This produces a .dsp file that you can pull into developer studio, and this will allow you to perform source-level debugging, breakpoints etc.

aamer4yu
13th November 2008, 07:14
May be this thread (http://www.qtcentre.org/forum/f-newbie-4/t-qt4-install-16962.html) will help you ...