Results 1 to 6 of 6

Thread: Have qmake add the C debugging option (-g)

  1. #1
    Join Date
    Jan 2007
    Posts
    29
    Thanks
    3

    Default Have qmake add the C debugging option (-g)

    Got a head scratcher. I want my program compiled w/ the -g debugging flag to valgrind won't be so damn cryptic. Can't figure it out though... any help?

  2. #2
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Have qmake add the C debugging option (-g)

    Run QtAssistant, on Index tab type "qmake" and then click twice on "qmake Variable Reference" and look for a variable suitable for you, but anyway, I think that qmake adds -g in debug on Linux but I'm not sure.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  3. #3
    Join Date
    Jan 2007
    Posts
    29
    Thanks
    3

    Default Re: Have qmake add the C debugging option (-g)

    Apparently my QtAssistant as fubar as it's looking /usr/doc/qt/3. I can see the reference here which I assume is the same. I messed around with QMAKE_CXXFLAGS_DEBUG but got nothing so far.

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

    Default Re: Have qmake add the C debugging option (-g)

    -g should be added automatically by qmake for both debug and release builds, as far as I remember. But valgrind tends to be criptic regardless of the -g flag. Maybe you should change the params you run valgrind with? And think about adding a "-ggdb" option instead of pure "-g".
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jul 2007
    Location
    Jundiai/SP, Brazil
    Posts
    114
    Thanks
    5
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Have qmake add the C debugging option (-g)

    Hi,

    For pass parameters for the gcc you should use some special variables for this, as QMAKE_CXXFLAGS.
    Access in your QtAssistance this URL qthelp://com.trolltech.qmake.453/qdoc/qmake-manual.html. (if you are using this version)
    or type qmake inside 'Search for' field and select QMake Manual

    Add this variables inside you .pro file like this:

    unix : QMAKE_CXXFLAGS = -g

    if you are using Window$ native ou *unix native plataform the prefix unix: ou win32: isn't necessary.

  6. #6
    Join Date
    Jan 2007
    Posts
    29
    Thanks
    3

    Default Re: Have qmake add the C debugging option (-g)

    Hey Guys: Sorry for the late reply.

    >> vcp

    That's the one -- I've got the -g in in there now. Thanks a mil.

    >>wysota

    Indeed, it is, but w/ -g it should give me more info. Line numbers, specifically, which is crucial for large projects.

    Thanks again.

Similar Threads

  1. qmake: removing --no-undefined option for libs.
    By davemar in forum Qt Programming
    Replies: 2
    Last Post: 14th October 2009, 09:08
  2. Is QTimer is the only option ?
    By nrabara in forum Newbie
    Replies: 6
    Last Post: 6th May 2009, 06:59
  3. using the lib template dll option on *nix
    By jamadagni in forum Qt Programming
    Replies: 3
    Last Post: 19th April 2007, 13:14
  4. qmake debug/release scope and disabling debugging output
    By No-Nonsense in forum Qt Programming
    Replies: 7
    Last Post: 12th March 2007, 15:48

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.