Results 1 to 2 of 2

Thread: How to build Qt statically on Windows?

  1. #1
    Join Date
    Aug 2009
    Location
    United States
    Posts
    45
    Thanks
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default How to build Qt statically on Windows?

    I'm a Qt newbie and cannot for the life of me figure out how to deploy my simple application. From the reading I've done, it seems that after building Qt statically I can simply add the following line to my .pro file:

    Qt Code:
    1. CONFIG += static
    To copy to clipboard, switch view to plain text mode 

    However, I cannot get Qt to build statically. Here are the pages I've been reading and trying to follow:

    http://doc.qt.digia.com/4.7-snapshot/deployment.html
    http://doc.qt.digia.com/4.7-snapshot...t-windows.html
    http://qt-project.org/wiki/Build_Sta...on_for_Windows
    http://www.anavi.org/article/140/
    http://qt-project.org/forums/viewthread/13032

    ...in addition to many threads on this forum.

    Maybe I'm just stupid, but I cannot figure this out.

    Can anyone help me?

  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: How to build Qt statically on Windows?

    Open your Qt SDK command prompt. Your compiler environment needs to be correctly set up for the configuration to detect.
    Change directory to the top of a Qt sources tree. The folder will contain files like configure.exe, INSTALL, README and folders like src/, qmake/ etc.
    Execute:
    Qt Code:
    1. configure -static -release -no-exceptions // + whatever options you need especially for plugins
    To copy to clipboard, switch view to plain text mode 
    Answer the licence questions then watch as the build is configured. Have coffee, a power nap...
    Once configured, execute:
    Qt Code:
    1. mingw32-make sub-src
    2. // for MingW or, for Microsoft compilers,
    3. nmake sub-src
    To copy to clipboard, switch view to plain text mode 
    Make a meal, read a good book, volunteer at your local welfare organisation...

    Straight from Deploying an Application on Windows

  3. The following user says thank you to ChrisW67 for this useful post:

    N3wb (8th October 2012)

Similar Threads

  1. Build qml statically
    By awarrior in forum Installation and Deployment
    Replies: 4
    Last Post: 23rd May 2014, 11:25
  2. Replies: 3
    Last Post: 10th October 2011, 07:50
  3. Replies: 0
    Last Post: 18th June 2010, 21:20
  4. How can i build an app statically?
    By srohit24 in forum Installation and Deployment
    Replies: 8
    Last Post: 20th April 2010, 09:38
  5. How can I build <<hello world>> example statically
    By krivenok in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2006, 15:25

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.