Results 1 to 3 of 3

Thread: shared versus static build

  1. #1
    Join Date
    Jan 2006
    Posts
    73
    Thanks
    16
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default shared versus static build

    Hi,
    I am using qt4.1 for Windows Open Source and I built fist built Qt "shared". Then I built it "static". If I want to have my exe released in a "share" mode again, do I need to rebuild Qt using first configure -shared? Is there a way to switch from "shared" to "static" without having to rebuild qt? thanks in advance

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: shared versus static build

    I think it is enough to add "CONFIG+=static" to your project file (not sure about it though, if not, you have to provide some switch for your compiler).

  3. #3
    Join Date
    Jan 2006
    Location
    Scandinavia
    Posts
    62
    Thanks
    5
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: shared versus static build

    I'm not completely sure here but it's very easy for you to test my solution.
    If CONFIG+=static (as suggested above) works then the binary will be (much) bigger than the normal shared binary. Just compile twice with different Makefiles one with static and one with shared and compare.

    If it doesn't work then you'll probably also have to set the Windows QT path, much like you set the PATHS normally in Windows. If you don't know how to do this then just check the installation instructions that trolltech has for Qt on Windows. The PATH model is more of a pain since you'll have to change the path every time you want to switch between shared/static.

    Good luck

Similar Threads

  1. shared vs static
    By alisami in forum Installation and Deployment
    Replies: 3
    Last Post: 4th October 2008, 13:04
  2. Replies: 16
    Last Post: 23rd May 2008, 10:12
  3. build debug with shared and release with static?
    By Thor28 in forum Qt Programming
    Replies: 4
    Last Post: 14th April 2008, 22:32
  4. Please Help-->have few doubts with Static build in Windows !
    By Krish in forum Installation and Deployment
    Replies: 1
    Last Post: 17th March 2008, 14:37
  5. Windows XP Qt 4.3.2 Static build
    By maxpower in forum Installation and Deployment
    Replies: 9
    Last Post: 2nd November 2007, 04:49

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.