Results 1 to 9 of 9

Thread: QT Creator DLL Question (Windows)

  1. #1
    Join Date
    Nov 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QT Creator DLL Question (Windows)

    Note: Yes, I have seen other threads asking the same question. I haven't been able to find one that I can understand. I am a noob to Qt.

    I need help. I have just recently began using QT, and I am using QT Creator as the ide (love it by the way). One problem that I have, is that programs created with QT require the QT Dlls, and even a simple application turns out huge because I would have to send the Dlls with the executable. This wouldn't be a problem, except that the dlls are HUGE. I made a simple little program that edits web pages, it shouldn't be over 200 megabytes...

    I have looked on Google and in the documentation for a while now, and it seems that the solution most offered is to link Qt Creator to a "static library". I can't find any good information on how to do this, and don't know if this is even what I need to do.

    Basically: I need to link the libraries so I don't have to distribute the program as a huge file loaded with dlls.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT Creator DLL Question (Windows)

    You need to recompile Qt so you have a static build, then you can link against this build rather than the default which uses DLLs.

    Read the license first though - if you statically link, your program must be either open-source or you must purchase a license from Nokia.

    If you distribute the DLLs instead, you don't need to purchase a license, and your program can be closed-source. This is the default. Its also better, as you only need one copy of the DLLs on any one machine, rather than every program statically linking to them and using up memory and disk space.

  3. #3
    Join Date
    Nov 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT Creator DLL Question (Windows)

    So how should I distribute the program? The folder with the dlls and executable is 100 megabytes. Should I just accept that and publish it like that or should I link it statically? The program will be under the GPL so that isn't an issue.

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT Creator DLL Question (Windows)

    100MB seems quite large, which DLLs are you using and how big is your exe?

    Typically I would distribute your program first in one archive, and then state something like "This application requires the Qt runtime libraries. You can download those seperately here if you don't have them already."

  5. #5
    Join Date
    Nov 2009
    Posts
    129
    Thanks
    4
    Thanked 29 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT Creator DLL Question (Windows)

    Quote Originally Posted by Sisco55 View Post
    So how should I distribute the program? The folder with the dlls and executable is 100 megabytes. Should I just accept that and publish it like that or should I link it statically? The program will be under the GPL so that isn't an issue.
    On the machine that doesn’t have Qt installed, move all the Qt DLLs out of the distribution folder. Attempt to run the program — you’ll get an error message naming a DLL. Move that DLL back into the folder, and try again. Repeat until you don’t get an error message.

    You’ll probably find that you now have a running program without nearly so many DLLs.

  6. #6
    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: QT Creator DLL Question (Windows)

    Quote Originally Posted by Sisco55 View Post
    I made a simple little program that edits web pages, it shouldn't be over 200 megabytes...
    I'd assume you have linked to debug versions of the libraries. Release ones should be much (10 times?) smaller.
    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.


  7. #7
    Join Date
    Nov 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT Creator DLL Question (Windows)

    That was the problem, I linked to the debug libraries.

    But now there is a new problem. When I try and run the program it says this:



    Now what is wrong?

    Thanks for the help by the way.
    Last edited by Sisco55; 29th November 2009 at 21:13.

  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: QT Creator DLL Question (Windows)

    You have probably trying to use wrong libraries - the ones from Qt Creator instead of the ones your application was built against.
    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
    Nov 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT Creator DLL Question (Windows)

    Edit: Nevermind. Fixed it myself. I using the wrong dlls. I was using the dlls from C:\Qt\2009.04\bin instead of the dlls from C:\Qt\2009.04\qt\bin


    Thanks all for the help. You guys are awesome.
    Last edited by Sisco55; 29th November 2009 at 22:17.

Similar Threads

  1. Replies: 1
    Last Post: 16th November 2009, 07:10
  2. A different MySql Question (windows performance)
    By LWakeland in forum Qt Programming
    Replies: 0
    Last Post: 6th October 2009, 01:45
  3. Replies: 6
    Last Post: 4th February 2009, 07:46
  4. Replies: 5
    Last Post: 15th January 2009, 09:03
  5. Qt and windows vista
    By munna in forum General Discussion
    Replies: 8
    Last Post: 11th January 2006, 22:33

Tags for this Thread

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.