Results 1 to 3 of 3

Thread: Is it possible to link the qt library files into exe?

  1. #1
    Join Date
    Jun 2009
    Posts
    74
    Thanks
    23
    Thanked 2 Times in 2 Posts

    Question Is it possible to link the qt library files into exe?

    Hi All,

    I am using QT4.6 sdk (windows platform),
    When deploy the application,the QT dll files (Qtcore4.dll ,Qtgui4.dll ...) also
    need to deploy together.
    I am wondering if there is a way to link the qt library files into exe.
    I have found there are static library files( lib*.a) in QT directory, but
    add "config += static" doesn't work .

    Any suggestions?
    Many thanks & happy new year.

    hb

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Is it possible to link the qt library files into exe?

    "Static" is the way to go. If you have problems with that first have a look at the wiki: http://wiki.qtcentre.org/index.php?t...c_applications.

    But be aware that if you link statically you have to use GPL or a commercial licence of Qt.

  3. #3
    Join Date
    Feb 2007
    Posts
    16
    Thanks
    2
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Is it possible to link the qt library files into exe?

    You have to build Qt statically. It's an option in the configure script. Then you can link against the libs you found and it will work like you expected. (Note that when you build Qt normally, the libs in the Qt directory are merely DLL import libraries. They are not static Qt libs. The names are different too. The static libs don't have a 4 on the end. )

Similar Threads

  1. Replies: 4
    Last Post: 7th April 2010, 23:09
  2. Replies: 2
    Last Post: 7th September 2009, 21:13
  3. Problem with NCReport : can't link shared library !
    By QAmazigh in forum Qt Programming
    Replies: 4
    Last Post: 5th June 2009, 23:38
  4. How to link library?
    By Macok in forum Qt Tools
    Replies: 1
    Last Post: 31st March 2009, 16:47
  5. Link against library on Mac OS
    By janus in forum Installation and Deployment
    Replies: 2
    Last Post: 22nd March 2009, 11:10

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.