Results 1 to 5 of 5

Thread: DLL independent development?

  1. #1
    Join Date
    Nov 2011
    Posts
    12
    Thanked 5 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question DLL independent development?

    I'm aware that this have been asked throughout the years that QT has existed, but the question still boggles me.

    Can we link the libraries statically to our Binary, so that our C++ code truly differs from Java and .NET based coding?
    By libraries, i mean all of them, as in: Mingwm10.dll, QTcore.dll, etc, etc(Might have gotten the names wrong).

    And if they are statically linked to our Binary, how much space would it take up?
    I would appreciate 'in-depth' answers.



    Regards, Franck.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: DLL independent development?

    Quote Originally Posted by Sia View Post
    Can we link the libraries statically to our Binary,
    Yes, within the constraints of their licences. If you statically link to GCC components then you may make your code subject to the GPL. You cannot capture all the dependencies; for example the Microsoft C runtime library will still be a DLL dependency.
    so that our C++ code truly differs from Java and .NET based coding?
    I don't know what difference you are referring to: Java and .Net require a set of runtime libraries, so will your C++ application (i.e. msvcrt.dll). You can bundle the needed non-standard dependencies with your application in all three cases.
    By libraries, i mean all of them, as in: Mingwm10.dll, QTcore.dll, etc, etc(Might have gotten the names wrong).
    mingwm10.dll will not be needed for recent MingW (http://thread.gmane.org/gmane.comp.gnu.mingw.user/36738).
    And if they are statically linked to our Binary, how much space would it take up?
    At least as much space as the compiled size of your program plus every Qt, C++ or C runtime function/class that is used directly or indirectly. I guess the worst case is that you get a single executable that's about the same size as all the DLLs put together.

  3. #3
    Join Date
    Nov 2011
    Posts
    12
    Thanked 5 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: DLL independent development?

    "the Microsoft C runtime library will still be a DLL dependency."
    I'm not sure as to what you are implying. QT is a cross-operating system development platform.
    .NET (Microsoft visual studio) is not cross-platform. And to my knowledge, i do not use any of the facilities of .NET based components.

    "mingwm10.dll will not be needed for recent MingW (http://thread.gmane.org/gmane.comp.gnu.mingw.user/36738)." Thank you Just a question, though, what are the 'mthreads'? Does QT not provide threading within their core library?


    "At least as much space as the compiled size of your program plus every Qt, C++ or C runtime function/class that is used directly or indirectly"
    It was a question directed towards: 'if anyone had tried it'. I heard someone got a size of 30(+)MB. Not sure if such claims were/are true, though.

  4. #4
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: DLL independent development?

    It was a question directed towards: 'if anyone had tried it'. I heard someone got a size of 30(+)MB. Not sure if such claims were/are true, though.
    It's possible.
    Depending on how many libraries you link against you could get that big binary.

    For example:
    Empty statically linked release Qt Gui project is 6.5MB big ( QCore and QGui static release libraries are together 16.4MB big ),
    Empty statically linked debug Qt Gui project is 140MB big ( QCore and QGui static debug libraries are together 223MB big ),
    (on my windows box with qt 4.7.4 and mingw32)

    So the binary most likely will be smaller than sum of libraries it links against but like ChrisW67 said, in worst case it may be as big as sum of their sizes.

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: DLL independent development?

    Quote Originally Posted by Sia View Post
    "the Microsoft C runtime library will still be a DLL dependency."
    I'm not sure as to what you are implying. QT is a cross-operating system development platform.
    .NET (Microsoft visual studio) is not cross-platform. And to my knowledge, i do not use any of the facilities of .NET based components.
    I didn't mention .Net, and I didn't say that Qt was not cross-platform. I said that, on Windows, even a statically linked Qt application may have a runtime dependency on Microsoft's C runtime library because it is generally assumed to be present and is not linked statically. You can probably do it with Microsoft's compiler.
    Just a question, though, what are the 'mthreads'? Does QT not provide threading within their core library?
    Yes, Qt provides platform-independent threading classes to the application programmer. Internally, these classes are built on top of the host operating system's threading libraries.
    MingW uses a library called mthreads on top of Windows and this will replace functionality in the mingwm10.dll.

Similar Threads

  1. Independent scaling behavior for QGraphicsItems
    By avant in forum Qt Programming
    Replies: 1
    Last Post: 30th May 2010, 20:11
  2. QRegExp independent subexpressions
    By Nik8768 in forum Newbie
    Replies: 9
    Last Post: 18th April 2010, 23:28
  3. Scale independent QGraphicsItem
    By Twoslick in forum Qt Programming
    Replies: 3
    Last Post: 24th March 2010, 05:59
  4. Platform independent GUI
    By bnilsson in forum Qt Programming
    Replies: 39
    Last Post: 28th November 2009, 11:00
  5. Independent Right-Click Menus
    By HiFly in forum Qt Programming
    Replies: 5
    Last Post: 20th February 2009, 07:58

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.