[Qt-interest] Debug and release modes ?

Sean Harmer sean.harmer at maps-technology.com
Tue Jun 2 15:51:24 CEST 2009


On Tuesday 02 Jun 2009 06:33:37 Ferenc Stelcz wrote:
> Patric wrote:
> >  Hello,
> >   I have a very basic question. What's the difference between debug and
> > release modes in QT Creator ? I think debug is to compile while in
> > development process, and release is to compile the final product or
> > something ?
>
> It's pretty much like that. Debug builds are to be used with a debugger,
> like the GDB in QtCreator to debug your application in the testing phase.
> This produces larger binaries with lots of debug symbols to help you find
> bugs in your code. If you think your app is RTM :) then you simply compile
> it in release mode, with a smaller size and without debug symbols.
> Note however: when building in debug mode, you have to provide your
> environment with the appropriate debug build of Qt as well (for example
> QtCore4.dll is the release version and QtCore4d.dll is the debug version
> [note the d before the dot]) 
This is true on Windows as the debug and release builds use different c 
runtime libs which should not be mixed - if you do you will likely get random 
crashes. 

However, on linux (not sure about Mac) you can freely link your debug build 
app against release version Qt libs. In this case you only need to link againt 
a debug build of QT if you wish to be able to step into the Qt functions (not 
needed very often).

> On Windows platforms, using the Qt SDK
> installer, you don't get the debug version of Qt; keep that in mind! HTH
I've not tried it myself but since Qt Creator uses MinGW by default it may 
well behave like the linux case. I'm not sure which runtimes it uses (ie does 
it provide its own or does it re-use the MSVC ones?)

Cheers,

Sean




More information about the Qt-interest-old mailing list