views:

110

answers:

3

I had compiled Qt 4.6.2 from sources with VS 2008. Now I would like to be able to step into Qt sources while debugging my application. How do I make VS to pick up the framework sources?

Edit: I forgot to mention that qt was built statically, and I dont find any .pdb files anywhere... I belive that all the necessary data should be included in the debug .lib files?

Thanks

A: 

Make sure the .pdb file for your Qt assembly is in your bin directory, alongside the .dll, and you should be able to step into the source.

Brandon Satrom
Qt is built statically, there are no .pdb files, as there are no assemblies.
ak
Ah, well that's an issue :)
Brandon Satrom
+1  A: 

From your question,

I belive that all the necessary data should be included in the debug .lib files?

No need at all. There should not be any dlls or libs associated with Qt since you have the source files itself.

Say for example you want to step through QWidget.

So in the cpp file you will use like,

QWidget *trialWidget = new QWidget();

Now what you have to do is, you have to include the header file for QWidget (qwidget.h I guess) and the cpp file for QWidget (qwidget.cpp in that case).

Make note that, all the other classes that might be needing in the qwidget.h should also be included. Say for e.g qobject.h for QObject.

In this way you are replacing the dlls and libs with the source code itself, so that you can step into the Qt code available in the corresponding cpp files.

Hope it helps..

liaK
the .vcproj project file is generated by `qmake -tp vc` command, and it does not reference any framework sources, it will be quite painful to reference all the sources I need every time the project is regenerated... I think there should be an easier solution.
ak
+1  A: 

Did you compile the debug version of Qt ? To do so, you need to give -debug or -debug-and-release arguments to the configure step. I believe that even for static version, you will get pdb files.

tibur
I do have release and debug libs, but no .pdb files. I think Qt was configured with -debug-and-release, as it is the default option.
ak
Did you compile it using nmake ?
tibur
well I actually used a clone of nmake called jom to employ all four cores of my machine: http://labs.trolltech.com/blogs/2009/03/27/speeding-up-visual-c-qt-builds/
ak
I just tried to compile Qt on my computer:configure -static -debugand then nmake. And I get a lot of pdb files generated.
tibur
I remember that I also called `nmake clean` after compiling to get rid of the .obj files. It probably deleted .pdb files as well..
ak