Results 1 to 6 of 6

Thread: How to build in debug mode?

  1. #1
    Join Date
    Jan 2006
    Location
    Hannover, Germany
    Posts
    14
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to build in debug mode?

    Hi all,

    how can I build my application in debug mode and look at the output of the debugger? I use Qt 4.1, Suse Linux 9.3, gcc and gdb.

    Thanks a lot,
    Weilor

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    99
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to build in debug mode?

    What is in your pro file already?

    CONFIG should have debug and console options
    if they are not set already add them in your pro file like this :
    CONFIG += console

    Cheers

  3. #3
    Join Date
    Feb 2006
    Location
    Kirovohrad, Ukraine
    Posts
    72
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to build in debug mode?

    I thinks it's obvious, but nevertheless...
    QT should be compiled with either -debug or -debug-and-release

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to build in debug mode?

    To build your application in debug mode, add "CONFIG += debug" to your project file and rerun qmake.

  5. #5
    Join Date
    Jan 2006
    Location
    Hannover, Germany
    Posts
    14
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to build in debug mode?

    To build your application in debug mode, add "CONFIG += debug" to your project file and rerun qmake
    Thats an answer every newbie understands. Thanks!

  6. #6
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to build in debug mode?

    I had the same problem, but I'm running under Microsoft Visual Studio .Net 2003. I tried to add "CONFIG += debug" to my project file and reran qmake, but nothing happened.
    I compared the project-settings under .Net with a friend that had a project which worked under debug. I made the same changes, but still nothing happened.
    We then compared the project-file from .Net, with the extension vcproj, and then I saw that there were added a debug-section under the release-section under configuration.
    But I was missing two lines(don't know why, we made the projects the same way).
    Under the configuration-paragraph for debug, and the third <Tool>-paragraph I added these two lines:
    • GenerateDebugInformation="TRUE"
    • OptimizeReferences="1"
    as number 7 and 10 in that paragraph(probably not important).

    Voila, it worked

    Strange that these lines didn't add up when I ran qmake. I have no explanation of what happened, but I will look in to it.

    Cheers

Similar Threads

  1. Qt + Linux + Eclipse - debug using debug build?
    By will49 in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2012, 06:27
  2. QWT fails in debug build
    By steg90 in forum Qwt
    Replies: 1
    Last Post: 11th November 2011, 06:53
  3. Some very weird compilation warnings
    By MarkoSan in forum Qt Programming
    Replies: 21
    Last Post: 23rd January 2008, 16:48
  4. Replies: 2
    Last Post: 8th November 2007, 20:15
  5. What is debug mode for without MSVC?
    By firegun9 in forum Newbie
    Replies: 1
    Last Post: 5th September 2007, 17:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.