PDA

View Full Version : Qt + Linux + Eclipse - debug using debug build?



will49
30th June 2008, 17:47
Not really a Qt question, but..

I'm using Eclipse on Linux with Qt Integration to import my PRO file and compile my Qt 3.4 application.

Everything is working fine, but when I try to run my application using the debugger, it always runs against the release build not the debug build and I can't get any detailed debugging data.

I only seem have one Build configuration and Target in the Eclipse project.

I presume I should have a debug and release build configuration. Is that correct? How do I add or select a debug configuration that runs with the debug build and not release?

yop
30th June 2008, 17:54
There is no Qt 3.4 version. Do you mean 4.4 or 3.3?
Qt integration is built around Qt 4.x. If you are using 3.x then you have to replace the QMake builder to a custom one. I can help you with that, but I need to know which Qt version you 're using.

The new eclipse release (Ganymede, nice Greek name :)) has huge CDT improvements by the way.

will49
30th June 2008, 18:02
Sorry my mistake. I'm using QT 4.3.5 and Eclipse 3.4.0

So I still can't figure out if there is some setting I'm missing to "debug" using the debug build, or something else I need to do.

If I got to "Project" -> "Make Target" -> "Build" I do see "Qt Release Build" and "Qt Debug Build". But when I "F11" (debug), it uses the release and not debug build.

yop
30th June 2008, 19:29
Check under Run->Debug Configurations... the executable that the debugger will execute. Change that to the one generated by your debug build and you should be OK.

will49
30th June 2008, 20:50
Thanks for the reply. Some more info to make it a bit clearer:

1. When I do a "Project->Build Project" it builds the release version and puts the executable in "/release"

2. If I do a "Make Targets -> Build..." then select "Qt Debug Build", it compiles all of the objectcode stuff in "/debug", but the final executable is in "/release"

So what I really don't understand is:

1. How to I select the debug build so when I select "Build -> Build Project" it makes the debug binary and not the release? Otherwise its going to be debugging against an old version of the debug executable.

2. Should the debug executable be in /debug or /release?

yop
2nd July 2008, 20:01
1. When I do a "Project->Build Project" it builds the release version and puts the executable in "/release"


Project->Properties->C++ Make Project will show you what your builder runs at each build.



2. If I do a "Make Targets -> Build..." then select "Qt Debug Build", it compiles all of the objectcode stuff in "/debug", but the final executable is in "/release"


Check your .pro file. You should NOT have a DESTDIR variable.



1. How to I select the debug build so when I select "Build -> Build Project" it makes the debug binary and not the release? Otherwise its going to be debugging against an old version of the debug executable.


Project->Properties->C++ Make Project Check that Build (Incremental Build) says debug.



2. Should the debug executable be in /debug or /release?


This is irrelevant. Wherever you put it. The convention is obvious...

mimosa
13th April 2012, 06:27
Now a question following yop's comment: can we setup a project in 'Eclipse with Qt Integration' to have both Debug and Release configuration, such that we can configure separately and switch quickly between builds? What I mean with configure separately is to for example link a Debug static library to the Debug project config, and link a Release static library to the Release config.

Thanks for answering! This thread is very helpful to me!