Results 1 to 12 of 12

Thread: Compiling with debug symbols without needing QT debug libraries

  1. #1
    Join Date
    Feb 2006
    Posts
    32
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Compiling with debug symbols without needing QT debug libraries

    Hello,

    I want to compile my application in debug mode so I put:
    CONFIG += debug
    in my .pro file. However, this drags in libQt3Support_debug.so
    But I don't want to debug Qt, so I probably don't need this?! I wouldn't mind, but the debug package is 170 MB in size...

    Any ideas?

    System: Debian unstable
    QT 4.1.1

    Best regards

    Ben

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

    Default Re: Compiling with debug symbols without needing QT debug libraries

    The debug symbols (and some other things too) reside in the debug library (that's why it's so large), so you can't have debug mode without using a library which contains routines which make debugging work.

    libQt3Support is a library which implements backward compatibility with Qt3. You shouldn't need it. Try disabling it explicitely in your project file if you get linked with it.

  3. #3
    Join Date
    Feb 2006
    Posts
    32
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question Re: Compiling with debug symbols without needing QT debug libraries

    Thanks for your answer, but why do I need the QT debug symbols? As I said, I don't want to debug QT. I am unsure about the backtrace, perhaps they come in handy there.
    I think it's a qmake thing. Even with CONFIG += debug it should allow to link against the normal QT library, and probably should do so by default.

    I need the QT3 stuff, cause I've not yet ported every part of my application to QT4.

    Best regards

    Ben

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

    Default Re: Compiling with debug symbols without needing QT debug libraries

    So why do you need CONFIG += debug if you don't want to debug? "debug" means "debug", not "not debug". If you want to get rid of debugging symbols from the debug library you can issue a strip --strip-unneeded on it (just remember it is a one way operation). Debug library is not only about debugging symbols. Asserts and qDebug()s (and other things) probably sit there too.

  5. #5
    Join Date
    Feb 2006
    Posts
    32
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Compiling with debug symbols without needing QT debug libraries

    Quote Originally Posted by wysota
    So why do you need CONFIG += debug if you don't want to debug? "debug" means "debug", not "not debug".
    I think you are misunderstanding me. I do want to debug my application. Hence, I don't need QT's debugging symbols (which are totally irrelevant for my code), and shouldn't need to link against the debug version of the QT library.

    The thing is: I don't need to have the debug version of the, say, mySQL library to be able to debug my application.

    If I need the QT debug version of the library, I'd judge this to be a misdesign.

    Quote Originally Posted by wysota
    Debug library is not only about debugging symbols. Asserts and qDebug()s (and other things) probably sit there too.
    Well, that would be a different beast, though I somehow doubt it. If so, I'd say that is a misdesign.


    Best regards

    Ben

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

    Default Re: Compiling with debug symbols without needing QT debug libraries

    The case with MySQL is different. With external libraries you just call that library (entry point) which does some job and returns to your code. With Qt you use inheritance, virtual methods, etc. which cause the flow to enter your code from within Qt code too (so you have entry points and exit points in Qt libs) which often makes it very valuable to have debug information about Qt library too.

    If you insist on using a release library with debugging turned on, you can probably force qmake to use it by changing the contents of QMAKE_LIBS or other variables.

  7. #7
    Join Date
    Feb 2006
    Posts
    32
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Compiling with debug symbols without needing QT debug libraries

    Quote Originally Posted by wysota
    If you insist on using a release library with debugging turned on, you can probably force qmake to use it by changing the contents of QMAKE_LIBS or other variables.
    Thanks, that was a good idea. Unfortunately it seems QT sets those values after processing the qmake file, so doing -= inside does not work :-(

    Best regards

    Ben

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

    Default Re: Compiling with debug symbols without needing QT debug libraries

    Quote Originally Posted by bmesing
    Unfortunately it seems QT sets those values after processing the qmake file
    It's not possible. There is no "after". "After" qmake there is only the Makefile. You must have changed the wrong variable or changed it not the correct way.

  9. #9
    Join Date
    Feb 2006
    Posts
    32
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Compiling with debug symbols without needing QT debug libraries

    Well, I don't know what it is then, but I do

    message("LIBS: $${LIBS}")
    message("QMAKE_LIBS: $${QMAKE_LIBS}")
    message("QMAKE_LIBS_QT: $${QMAKE_LIBS_QT}")
    at the end of my qmake file. Both QMAKE_LIBS and QMAKE_LIBS_QT are empty, and LIBS only contains my manually defined libs.
    I've also tried most of the other variables, but got only some uninteresting libraries like -lpthread, -lX11,...).
    So unless I'm overlooking something, qmake must set the values after processing the qmake file. Or otherwise imply the command line options through the "config" values (without explicitly setting the variables). In both cases I have no idea how to convince QT not to link against the given library.

    Best regards

    Ben

  10. #10
    Join Date
    Mar 2006
    Location
    India
    Posts
    15
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Compiling with debug symbols without needing QT debug libraries

    well, this is a work-around.

    don't put CONFIG+=debug
    instead, just put -g in your CFLAGS and CXXFLAGS.
    Qt 4.2 (qt-copy in KDE svn)
    KDE 4.0 (svn)
    Currently developing Anthias

  11. #11
    Join Date
    Feb 2006
    Posts
    32
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Compiling with debug symbols without needing QT debug libraries

    Quote Originally Posted by ePharaoh
    well, this is a work-around.

    don't put CONFIG+=debug
    instead, just put -g in your CFLAGS and CXXFLAGS.
    Now it gets ugly :-) This way I would also lose the valuable information from my qDebug statements.
    It seems that there is no sane way to not link against the debug version, so I'll leave it for now. Perhaps QT folks will change this in time. I think in QT3, there was no need to have a debug version of the libary either.

    Best regards

    Ben

  12. #12
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Compiling with debug symbols without needing QT debug libraries

    Quote Originally Posted by bmesing
    Now it gets ugly :-) This way I would also lose the valuable information from my qDebug statements.
    It seems that there is no sane way to not link against the debug version, so I'll leave it for now. Perhaps QT folks will change this in time. I think in QT3, there was no need to have a debug version of the libary either.

    Best regards

    Ben
    Your qDebug statements will still work in release mode.
    Save yourself some pain. Learn C++ before learning Qt.

Similar Threads

  1. mysql 5 connection
    By GuL in forum Newbie
    Replies: 37
    Last Post: 18th August 2008, 16:11
  2. exception at 0x65100c40 (QtGuid4.dll)
    By sabeesh in forum Qt Programming
    Replies: 11
    Last Post: 21st December 2007, 18:10
  3. Program crashes with assert error in xcb_lock.c
    By Valheru in forum Qt Programming
    Replies: 3
    Last Post: 18th November 2007, 20:56
  4. KDE 3.5.0 crash while opening project
    By MarkoSan in forum KDE Forum
    Replies: 2
    Last Post: 19th October 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.