Static linking in Qt Comercial SDK
-
I don't know about Commercial SDK, but the old Nokia one had no sources prepared for compilation. You need to separately download commercial Qt source package and compile it on your machine with -static and -no-exceptions.
-
These are the exact lines I used to compile Qt statically:
@
./configure -prefix $PWD -nomake demos -nomake examples -nomake tests -release -static -no-exceptions -no-webkit -qt-zlib -qt-libpng -qt-libjpeg -arch x86 -dont-process -no-qt3support
bin/qmake projects.pro QT_BUILD_PARTS="libs" JAVASCRIPTCORE_JIT="yes"
make -j5
@ -
thank you ...and now..how can i build my project from qtCreator statically ?
-
First, make sure you are using the newly build Qt (Options->Build & Run->Qt Versions, and verify in project options). Then, as you noted:
@
// your .pro file if you are using qmake
CONFIG += static
@Adding the static objects explicitly to LIBS variable is a good idea, too. Here's a link with example: "LINK":http://qt-project.org/doc/qt-4.8/deployment-mac.html#static-linking.
Some people add other things here, too. You need to ask uncle Google for that.
-
I have this at the effective qmake call :
qmake.exe C:\Users\zolidznake\Desktop\silviu-saved-sources\HardwareInformation\HardwareInformation.pro -r -spec win32-msvc2008 "CONFIG+=debug" "CONFIG+=declarative_debug"
it will take automatically from my .pro file the CONFIG += static ?
thank you for helping ...
-
IIRC, qmake treats .pro files as more important than the command line arguments, so it should pick it up, yes.
-
when i try to build i get this :(
:-1: error: LNK1104: cannot open file 'c:\Qt\4.8.3-vs\lib\QtGuid.lib'
-
Well, is this file available at that location?
-
in build debug doesn't work...i builded the release ...it works fine...thank you much for your help !
-
Nice, I'm glad it worked :)