Results 1 to 16 of 16

Thread: Explain Qt library sizes, please

  1. #1
    Join Date
    Jan 2008
    Posts
    155
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Explain Qt library sizes, please

    Why are the (static) Qt debug libraries smaller than the (static) release libraries?
    E.g. qtmain.lib is 1019kb while qtmaind.lib is 64kb?
    The trend is consistent for all libs, it seems.
    I would expect the opposite?

    Platform: win32-msvc2008
    configure -debug-and-release -static -no-webkit
    nmake sub-src
    MacOSX user dabbling with Linux and Windows.

  2. #2
    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: Explain Qt library sizes, please

    Your qtmaind.lib is surely a dynamic export library not a static library.
    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.


  3. #3
    Join Date
    Jan 2008
    Posts
    155
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Explain Qt library sizes, please

    So my
    Qt Code:
    1. configure -debug-and-release -static -no-webkit
    2. nmake sub-src
    To copy to clipboard, switch view to plain text mode 
    did not do what I thought it would do?
    The .lib files are fresh from the build date, and as described in Assistant they are not named "*4.lib" or "*4d.lib", correct for a static build.
    And back to the original question, should there not be symbolic information in a debug library which is not present in a release library, thus making it (the debug library) bigger?
    My QtGui.lib is 211483kB and the QtGuid.lib is 70340kB. Since the debug libraries obviously works, what is the extra content in the release?
    MacOSX user dabbling with Linux and Windows.

  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: Explain Qt library sizes, please

    Does it really matter?
    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
    Jan 2008
    Posts
    155
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Explain Qt library sizes, please

    Why do you ask?

    I am trying to troubleshoot my installation, and I am not ready to give a complete description of my problems just yet.
    MacOSX user dabbling with Linux and Windows.

  6. #6
    Join Date
    Jan 2008
    Posts
    155
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Explain Qt library sizes, please

    Some libraries I've built for my own app also have larger release size then debug size, and I am not sure if I have by mistake swapped the targets. At deployment, the release libs should be linked to the app and not the debug libs.
    I am using the qt-vs addin, giving me LOTS of such problems, bugs are reported.
    On Mac, the debug libs are (I assume) containing more data than the release libs, that's why I am confused by what I see in win32-msvc2008.
    MacOSX user dabbling with Linux and Windows.

  7. #7
    Join Date
    Jan 2008
    Posts
    155
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Explain Qt library sizes, please

    More details about why I am interested:
    I tried to make a "release" app to run on another PC, but the app failed to start on the other PC.
    It needed VC90.CRT, which I installed using redist_x86.exe (or similar, dont' remember the name now).
    It still would not start, it needed VC90.DebugCRT, which is not redistributable according to Microsoft.
    This is why I suspect I have inconsistent debug/release app configuration, maybe linked to debug libraries when it should be release libraries.
    MacOSX user dabbling with Linux and Windows.

  8. #8
    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: Explain Qt library sizes, please

    Ok, but why are you interested in the size of a static debug library? Give me one example where it makes sense to use a static debug library.
    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.


  9. #9
    Join Date
    Jan 2008
    Posts
    155
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Explain Qt library sizes, please

    Ok, I will try to explain very very carefully so you can understand.

    If my project, for any reason, in the "release" configuration, instead of linking to a "release" library, which is my intention, links my app to a "debug" library, it will PROBABLY have a dependency to Windows "debug" environment, which is not available outside the PC which is created. Thus the deployed app will not work on any other PC than the one where it was created.
    My app is dependent on a library which is is made by me, and this library project produces both debug and release versions. If there is a unintentional swap between the debug and release versions of these libraries, I will link to the wrong version and my app will not run. I have reason to believe that the qt-vs-addin I am using is not stable and might screw up the output destinations, names and whatnot.
    One crude and primitive way of determining which is debug and which is the release version that actually are created could be by the size, since I expected the debug version would be larger. It seems to me this is not the case for Qt libraries, so I will have to skip this idea.

    Why would I want to use a static debug library? I do not.
    I want to make a static linked app to reduce the work in deployment, as described in Assistant. The project to create it will be static accordingly, and since I am a poor enough programmer to want to debug it to make it work, the debug configuration will use a static debug library.

    Since you do not seem to have an answer to my original question (or don't want to answer) I suggest we end this now.
    MacOSX user dabbling with Linux and Windows.

  10. #10
    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: Explain Qt library sizes, please

    Quote Originally Posted by bnilsson View Post
    If my project, for any reason, in the "release" configuration, instead of linking to a "release" library, which is my intention, links my app to a "debug" library, it will PROBABLY have a dependency to Windows "debug" environment, which is not available outside the PC which is created. Thus the deployed app will not work on any other PC than the one where it was created.
    So link it to the proper one... Where is the problem?

    One crude and primitive way of determining which is debug and which is the release version that actually are created could be by the size, since I expected the debug version would be larger. It seems to me this is not the case for Qt libraries, so I will have to skip this idea.
    The simplest way is to use dependency walker and see what libraries do each of them depend on.

    Why would I want to use a static debug library? I do not.
    I want to make a static linked app to reduce the work in deployment, as described in Assistant.
    By building in debug_and_release?

    The project to create it will be static accordingly, and since I am a poor enough programmer to want to debug it to make it work, the debug configuration will use a static debug library.
    While developing you should use dynamic libraries, unless you are paid by the hour and hard-disk space taken by the project. Statics should be used only for deployment.

    Since you do not seem to have an answer to my original question (or don't want to answer) I suggest we end this now.
    That's because your question is irrelevent to your problem. The size of the library can depend on the libraries that are linked into this library. If you link statically, you are embedding all the dependant static libraries available which is boosting the size of each library. If you want to compare release and debug library sizes (although I don't know why would you want to do that as it is meaningless - from what can be read in another thread Visual Studio saves its debug information into a separate file, so it doesn't boost the size of debug libraries), do it in dynamic mode where only the size of the library itself matters. Now you are comparing the libraries as you'd been comparing which car is better based on their weight because a better car will have more features so it will probably be heavier. It might be better to actually look into specs of both cars, don't you think? That's what dependency walker is for.
    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.


  11. #11
    Join Date
    Jan 2008
    Posts
    155
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Explain Qt library sizes, please

    Thanks for the explanation.
    I now see what my problem REALLY is.
    I did not understand how a .pro file works regarding the debug and release configs.
    I tried to do like this:
    Qt Code:
    1. win32: TEMPLATE = vcapp
    2. CONFIG += debug_and_release qt thread
    3. release {
    4. DESTDIR = Release
    5. INCLUDEPATH += GeneratedFiles GeneratedFiles/Release .
    6. MOC_DIR = GeneratedFiles/Release
    7. OBJECTS_DIR = Release/obj
    8. }
    9. debug {
    10. DESTDIR = Debug
    11. INCLUDEPATH += GeneratedFiles GeneratedFiles/Debug .
    12. MOC_DIR = GeneratedFiles/Debug
    13. OBJECTS_DIR = Debug/obj
    14. }
    To copy to clipboard, switch view to plain text mode 
    not understanding the the scope variables debug and release are BOTH defined when debug_and_release is used.
    I assumed that the conditionals would set up my VC release/debug project configurations accordingly, and this did not work. Now as the debug scope was handled after the release scope, the debug scope wins.

    Does the debug and release scopes in the .pro file have anything whatsoever to do with the generated VC project debug/release configurations?

    If they do, can you suggest a method to achieve what I want to do (if I can make myself understood)?
    MacOSX user dabbling with Linux and Windows.

  12. #12
    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: Explain Qt library sizes, please

    Use the following construct:
    "CONFIG(debug, debug|release) { ... }" for debug mode compilation and "CONFIG(release, debug|release){...}" for release mode compilation. Then when the compilation is in debug and release proper scopes will get activated.
    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.


  13. #13
    Join Date
    Jan 2008
    Posts
    155
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Explain Qt library sizes, please

    Thanks, this seems to work on win32-mcvc2008.
    However this does not seems to work on MacX, only GeneratedFiles/Debug is generated.
    But this is not serious for me at the moment.

    And still, the Win32 app wants VC90.DebugCRT to run on the other PC.
    I have removed my linked-in library and put the source directly in the project, so there cannot be any debug/release mixup, if there ever was.
    Any suggestions where I should look?
    I have used the dependency walker and I have not found anything debug-related so far.
    MacOSX user dabbling with Linux and Windows.

  14. #14
    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: Explain Qt library sizes, please

    Quote Originally Posted by bnilsson View Post
    Thanks, this seems to work on win32-mcvc2008.
    However this does not seems to work on MacX, only GeneratedFiles/Debug is generated.
    But this is not serious for me at the moment.
    It should work. Provided that debug_and_release is supported on Mac.

    I have used the dependency walker and I have not found anything debug-related so far.
    Did it show a dependency on the debug version of the C runtime? What exactly depended on it?
    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.


  15. #15
    Join Date
    Jan 2008
    Posts
    155
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Explain Qt library sizes, please

    I tried again on another development PC, installed Qt like this in the VC2008 command window:

    configure -static -release - no-webkit
    nmake sub-src

    So no static debug libraries were built.

    Now I could build the release app and it finally worked at the target PC.
    So far so good.

    However, I failed to make the (same) VC project build a debug shared app, since the settings in the VC debug configuration was not properly set for this.
    I had previously built Qt shared in the development PC so the shared libs were there also.
    Is it possible to have a single VC project with both shared(debug) and static(release) builds?

    And if it is, is it possible to have this generated by a single .pro file by qmake (with TARGET vcapp)?


    In general, how does one usually set up the Qt/vc environment for shared debugging and static deployment?
    MacOSX user dabbling with Linux and Windows.

  16. #16
    Join Date
    Jan 2008
    Posts
    155
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Explain Qt library sizes, please

    As this discussion drifted a bit since the original question, I move the shared debug / static release build to another thread.
    MacOSX user dabbling with Linux and Windows.

Similar Threads

  1. Extending a plugin in a static library
    By ultim8 in forum Qt Programming
    Replies: 5
    Last Post: 25th March 2010, 15:10
  2. Replies: 4
    Last Post: 18th December 2009, 18:55
  3. plugin in a library
    By alisami in forum Qt Programming
    Replies: 2
    Last Post: 3rd October 2008, 17:21
  4. Adding library dependencies to qmake
    By sadastronaut in forum Installation and Deployment
    Replies: 2
    Last Post: 18th March 2008, 17:06
  5. Replies: 1
    Last Post: 5th March 2007, 20:50

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.