[Interest] Debugging on Linux

Lincoln Ramsay lincoln.ramsay at nokia.com
Thu Nov 3 04:39:41 CET 2011

On 11/02/2011 11:17 PM, ext David Faure wrote:
> Not sure -debug-and-release works on linux.

No, it does not work. configure's help indicates this and configure even 
warns you if you pass -debug-and-release but it doesn't die so you 
probably missed the message as it scrolled off your screen :(

Unlike Windows and Mac OS, Linux does not force you to choose between 
incompatible system libs that are ether "debug" or "release" so there's 
no technical reason to build two versions of each library.

The default on Linux is an optimized build with debug symbols moved into 
a separate .debug file. You can pass -debug for an un-optimized build. 
You can pass -no-separate-debug-info to avoid putting the debug symbols 
in the separate .debug file. You must combine -no-separate-debug-info 
and -release to turn off generation of debug symbols.

If you want an optimized and an un-optimized version of the libs you'll 
need to do two separate builds. I don't believe there are any issues 
combining optimized and un-optimized versions of the libs together and 
you can have debugging symbols in both cases. However, an optimized 
build can't have debugging symbols in the binaries unless you manually 
get -g onto the compiler commandline.

Lincoln Ramsay - Senior Software Engineer
Qt Development Frameworks, Nokia - http://qt.nokia.com/

More information about the Interest mailing list