Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Static linking for windows
Forum Updated to NodeBB v4.3 + New Features

Static linking for windows

Scheduled Pinned Locked Moved General and Desktop
24 Posts 12 Posters 37.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • . Offline
    . Offline
    ..k1..
    wrote on last edited by
    #21

    Thank You Cezary Tomczak!

    this:
    [quote author="Cezary Tomczak" date="1291037300"]

    • I deleted the whole lib/ directory along with fonts and readme.
    • I didn't touch bin/ directory, all files are still there
    • win32-g++/qmake.conf, I didn't add "DEFINES += QT_STATIC_BUILD"
    • also not this: bin\qmake.exe projects.pro QT_BUILD_PARTS=”libs” JAVASCRIPTCORE_JIT=”yes”
      [/quote]

    helps me a lot, after days tearing out my hair.

    http://hunix.info/webimg/bugStop.jpg

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Billa
      wrote on last edited by
      #22

      Could You Explain Even more on this
      [quote author="Gerolf" date="1290842572"]Hi,

      if all you need is a static build of Qt, done with mingw, do the following:

      extract Qt-...-src.zip (that is without any temporary file that mighjt disturb) :)

      Change path-to-qt\mkspecs\win32-g++\qmake.conf:
      @
      QMAKE_CFLAGS_RELEASE = -Os -momit-leaf-frame-pointer
      QMAKE_LFLAGS = -static -static-libgcc -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc

      cd %qtdir%
      configure -static -release -no-exceptions -[other parameters like -mmx -sse -sse2 -3dnow etc...]
      mingw32-make sub-src [here you can make some coffee etc.. it will take some time]
      @

      If you use webkit, you have to change the webkit pri file also:
      \src\3rdparty\webkit\ WebKit.pri:
      CONFIG += staticlib

      For builds after making the changes in the config files, I used a batch file:
      @set QTDIR=D:\Developement\Qt\2010.04\qt_static
      set PATH=D:\Developement\Qt\2010.04\qt_static\bin
      set PATH=%PATH%;D:\Developement\Qt\2010.04\bin;D:\Developement\Qt\2010.04\mingw\bin
      set PATH=%PATH%;%SystemRoot%\System32
      set QMAKESPEC=win32-g++

      mingw32-make confclean
      configure.exe -release -confirm-license -qt-libpng -opensource -no-incredibuild-xge -process -static
      mingw32-make
      @[/quote]

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on last edited by
        #23

        you can have a look at the wiki: "How to build a static Qt version for Windows with GCC":http://developer.qt.nokia.com/wiki/How_to_build_a_static_Qt_version_for_Windows_with_gcc

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        1 Reply Last reply
        0
        • C Offline
          C Offline
          cppdeveloper
          wrote on last edited by
          #24

          The solution for me is the following currently:

          1. Download Qt SDK 4.7.0 (4.7.1 - 4.7.3 not working):

          ftp://ftp.qt.nokia.com/qtsdk/qt-sdk-win-opensource-2010.05.exe

          (from ftp://ftp.qt.nokia.com/qtsdk)

          1. Statically build Qt according to instructions:

          http://doc.trolltech.com/4.7.1/deployment-windows.html#static-linking

          1. Statically build your apps according to the above instructions.

          I hope these will help you.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved