Results 1 to 3 of 3

Thread: Qt 4.3 static linking on Windows

  1. #1
    Join Date
    Apr 2008
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qt 4.3 static linking on Windows

    Hello, I am trying to make my application link statically against Qt libraries on windows xp. I use MinGW. I have both staitic (.a) and dynamic (.dll) libraries in my Qt lib directory. In two attempts I added CONFIG += static and CONFIG += staticlib in my .pro file but both times the application linked dynamically. I know that because it wanted QtCored4.dll. Please answer the following questions:
    How can I tell if Qt was built with static support other than knowing it was built with -static option?
    How can I tell the make tool to use static linking?
    Thank you in advance for any help you offer.

  2. #2
    Join Date
    Apr 2008
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.3 static linking on Windows

    I managed to completely reinstall Qt with -static switch enabled. Now I have static Qt libraries and I compiled and linked the application and it works ok even when I rename the Qt directory which by my opinion means that it was statically linked.

  3. #3
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.3 static linking on Windows

    You can use Dependency Walker to see if your app dependens on a Qt lib or not.


    And in your first post you're wrong - you did not had both static and dynamic Qt libs in your lib folder but static import libs and dynamic qt libs.

Similar Threads

  1. Replies: 16
    Last Post: 23rd May 2008, 10:12
  2. gentoo qt4 static linking
    By powermax in forum Newbie
    Replies: 1
    Last Post: 27th April 2008, 21:11
  3. Replies: 2
    Last Post: 4th December 2007, 00:34
  4. Windows XP Qt 4.3.2 Static build
    By maxpower in forum Installation and Deployment
    Replies: 9
    Last Post: 2nd November 2007, 04:49
  5. Replies: 4
    Last Post: 20th February 2006, 09:11

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.