Reputation: 423
From wiki we know “Support for static Qt builds making it possible to address those use cases that cannot use dynamic linking”
I have tired adding CONFIG += static , but not gonna work .
How to compile code staticaly without compile the whole qt project ?
before Qt5.1.0 we all can compile the code statically after build the qt project
but this time ,qt 5.1.0 wiki said new features include “Support for static Qt”
Upvotes: 1
Views: 813
Reputation: 49279
You need to do a static build of Qt before you can build statically linked applications with it. You have to specify -static
when you configure it prior to building. None of the existing pre-built packages supports static linking out of the box.
Keep in mind there is a restriction - you cannot use static linking in commercial applications unless you have a commercial license. But it is ok for testing purposes and open source stuff.
Upvotes: 4