How am I supposed to use my static build of Qt in my project directory? There seems to be a missing step in the official documentation between building a static version of Qt and then building a statically-linked version of your app with that static version of Qt.
-
What exactly is missing? You configure with `-static` and in your .pro you add `CONFIG+=static` – cen Sep 10 '14 at 19:59
-
@cen You're wrong. The CONFIG+=static is not needed. – Kuba hasn't forgotten Monica Sep 11 '14 at 14:49
1 Answers
There's no explicit step, since all you need to do is use that statically-compiled Qt to build your project. That's all. From the command line, simply invoke the statically-compiled Qt's qmake
and your project will statically link to Qt. From Qt Creator, add the statically-compiled Qt's kit to your project's configurations and build for it.
Of course you must first add that Qt version to Qt Creator, and add it to a new kit. Note that as far as both Qt and Qt Creator is concerned, a "Qt version" is a synonym for a build of Qt. So if you have 4 different builds of Qt 5.3.1 (say dynamic multithreaded, dynamic single threaded, static multithreaded, and static), they are considered different Qt versions. Because a "Qt version", as used throughout, has nothing whatsoever to do with the sources of Qt, just with a build of Qt. If all you do is download a source package of Qt, you have no Qt versions yet :)

- 95,931
- 16
- 151
- 313