How to build with static link using qt 4.7.4 for desktop based exe
-
Use info from here http://www.formortals.com/build-qt-static-small-microsoft-intel-gcc-compiler/.
-
Hi
which i find to be the best resource to do so.
-
Do not(!) recompile Qt out of the sources bundled with the SDK or any other prebuilt package. This will both wreck your current installation and you won't be able to compile your new version.
Grab yourself the "vanilla sources":http://qt.nokia.com/downloads/downloads#qt-lib instead.
-
i have installed "Qt libraries 4.8.0 for Windows (VS 2008, 273 MB)" since i have VS 2008.
then could able to configure for static with command
"configure -static -fast -release -confirm-license -opensource -platform win32-msvc2008"
then successfully gave "nmake"From Qt creator added the qmake.exe from qt4.8 and when i tried to compile qt 4.7.4 installer source code getting the below error :
installer.lib(init.obj):-1: error: LNK2019: unresolved external symbol "class QObject * __cdecl qt_plugin_instance_qsqlite(void)" (?qt_plugin_instance_qsqlite@@YAPAVQObject@@XZ) referenced in function "public: __thiscall
void __cdecl initResources(void)'::
6'::StaticqsqlitePluginInstance::StaticqsqlitePluginInstance(void)" (??0StaticqsqlitePluginInstance@?5??initResources@@YAXXZ@QAE@XZ)But i am able to compile qt 4.7.1 version of installer source code.
/Pradeep
-
Please see this:
[quote author="Volker" date="1326454385"]Do not(!) recompile Qt out of the sources bundled with the SDK or any other prebuilt package. This will both wreck your current installation and you won't be able to compile your new version.
Grab yourself the "vanilla sources":http://qt.nokia.com/downloads/downloads#qt-lib instead.[/quote]
You must not use the sources delivered with the prebuilt.
-
I am not getting your points.
just i want to compile the latest QT installer source code for our product and want to link it statically.
I tried to compile the source using qt 4.7.4 sdk and could not compile it statically as there is no configure.exe..so as suggested by Volker i have installed Qt 4.8.0 pkg for VS 2008 and configured for static. Then used the same qmake.exe to compile the opensource installer code but its failing with some linking errors.
FYI : i could able to compile the old version of installer source code using the same qmake.exe
could you please suggest me how i can compile them statically.
/Pradeep -
Did you download the sources you like to compile separately?
The sources as delivered with the SDK and/or the prebuilt you cannot compile. If you like to build a static version you need to download the source from the link supplied by Volker. If you like to build under windows you need to use the zip-file. -
[quote author="pradeep.symbian" date="1326881439"]
so as suggested by Volker i have installed Qt 4.8.0 pkg for VS 2008 and configured for static. Then used the same qmake.exe to compile the opensource installer code but its failing with some linking errors.[/quote]NO, I did not suggest this. I told you you to download the vanilla sources and not to recompile Qt out of the sources bundled with the SDK or any other prebuilt package.
-
[quote author="Pradeep Biswal" date="1326885211"]@Volker: where is the Vanilla sources ?
i downloaded the pre compiled version of qt 4.8.0 from http://qt.nokia.com/downloads/downloads#qt-libPlz give me a link from where i can download.
[/quote]
Search for "source" on that page....
bq. Here is the latest version of the Qt libraries. The edition you download here must match the OS you have your development system on.
The source code is available as a zip (261 MB) or a tar.gz (228 MB). Or visit the repository at qt.gitorious.org/qt. -
I have downloaded the source as qt-everywhere-opensource-src-4.8.0.zip and configured for static.
Now while building its giving me error as
LINK : fatal error LNK1181: cannot open input file 'qsqlite.lib'
and i searched and could not found the qsqlite.lib or dll in that dir.
where as in installed other qtsdk say qtsdk 4.7.4 has sqlite libs as C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\plugins\sqldrivers\qsqlite4.lib and dll.
how to resolve this linking error?
-
to resolve the above error i am following the below link.. let's see if it resolves the error
http://developer.qt.nokia.com/doc/qt-4.8/sql-driver.html#qsqlite
-
it did not solve the problem. still i am getting the same error as
link /LIBPATH:"c:\Qt\src\qt-everywhere-opensource-src-4.8.0\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /MANIFEST /MANIFESTFILE:".obj\installer.intermediate.manifest" /OUT:..\lib\installer.dll @C:\Users\prbiswal\AppData\Local\Temp\installer.dll.6264.62993.jom
LINK : fatal error LNK1181: cannot open input file 'qsqlite.lib'Need your help to resolve this.
-
it did not solve the problem :
its giving the same error as
link /LIBPATH:"c:\Qt\src\qt-everywhere-opensource-src-4.8.0\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /MANIFEST /MANIFESTFILE:".obj\installer.intermediate.manifest" /OUT:..\lib\installer.dll @C:\Users\prbiswal\AppData\Local\Temp\installer.dll.6264.62993.jom
LINK : fatal error LNK1181: cannot open input file 'qsqlite.lib' -
Hi All,
Issue is resolved :)
I will share how this worked...
- downloaded the qt 4.7.4 source using "maintain qt sdk" tool (can be found from windows>>start>>qtsdk>>maintain qt sdk). This basically downloads the source package for diff releases from the repository.
- once update/download is successful then you can find the source code and some tools under %installed Qt SDK 4.7.4%\QtSources\4.7.4\ (for me its under C:\QtSDK\QtSources\4.7.4)
- Now for Qt static release build just follow http://qt.gitorious.org/qt-labs/installer-framework/blobs/master/README
and it works. i could able to create the single exe.