Unable to static compile Qt 2010.05
-
Hi,
For a project we are working on I need to re-compile Qt 2010.05 statically but it fails with the following error:
@g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
-DGL_SUPPORTED -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_SCRIPT_LIB -DQT_SQL_LIB -
DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -
DQT_NEEDS_QMAIN -I"....\include\QtCore" -I"....\include\QtNetwork" -I"....\in
clude\QtGui" -I"....\include\QtOpenGL" -I"....\include\QtSql" -I"....\include
\QtScript" -I"....\include\QtDeclarative" -I"....\include" -I"c:\Build\OpenSSL
\include" -I"." -I"....\include\QtDeclarative" -I"....\src\declarative\util" -
I"....\src\declarative\graphicsitems" -I"." -I"....\include\ActiveQt" -I"tmp\m
oc\release_static" -I"....\mkspecs\win32-g++" -o tmp\obj\release_static\qrc_sta
rtup.o tmp\rcc\release_static\qrc_startup.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o ....\bin\qmlviewer.exe object
_script.qmlviewer.Release -L"c:\Build\qt\qt\lib" -L"c:\Build\qt\qt\lib" -lmingw
32 -lqtmain -lQtDeclarative -lQtScript -lQtSvg -lQtSql -lQtXmlPatterns -lQtOpenG
L -lglu32 -lopengl32 -lQtGui -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwin
spool -lmsimg32 -lQtNetwork -lQtCore -lkernel32 -luser32 -lshell32 -luuid -lole3
2 -ladvapi32 -lws2_32 -Lc:\Build\OpenSSL\lib
c:\Build\qt\qt\lib/libQtDeclarative.a(qdeclarativevaluetype.o):qdeclarativevalue
type.cpp:(.text+0x4c8): undefined reference to_imp___Z13qt_defaultDpiv' c:\Build\qt\qt\lib/libQtDeclarative.a(qdeclarativevaluetype.o):qdeclarativevalue type.cpp:(.text+0x552): undefined reference to
_imp___Z13qt_defaultDpiv'
collect2: ld returned 1 exit status
mingw32-make[3]: *** [....\bin\qmlviewer.exe] Error 1
mingw32-make[3]: Leaving directoryC:/Build/qt/qt/tools/qml' mingw32-make[2]: *** [release] Error 2 mingw32-make[2]: Leaving directory
C:/Build/qt/qt/tools/qml'
mingw32-make[1]: *** [sub-qml-make_default-ordered] Error 2
mingw32-make[1]: Leaving directory `C:/Build/qt/qt/tools'
mingw32-make: *** [sub-tools-make_default-ordered] Error 2@The configure options I used were:
C:\Build\qt\qt>configure -release -static -openssl -qt-style-windowsxp -qt-style -windowsvista -I C:\Build\OpenSSL\include -L C:\Build\OpenSSL\lib
followed by mingw32-make
Any help would be gratefully appreciated as we need to rebuild a piece of code ASAP and cannot get past this point :(
-
Have you read "this":http://developer.qt.nokia.com/wiki/How_to_build_a_static_Qt_version_for_Windows_with_gcc? Maybe can help you.
-
I did indeed and that didn't even get as far. With respect to that why would they have a -static configure option if you have to hack away at other files ?
-
Is not simple build static lib qt, but most of project use dynamic library because have a lot of benefits.
You want build static qt for a closed project? Remember static qt can't use in LGPL application. -
When you can't rebuild Qt installed with the SDK, you can download just the Qt sources and static build the sources (and you can have both versions of Qt installed)
If you want to rebuild the one installed by with SDK, most likely, you will need to do some cleanup, because some older files (make, temporary) might break your build.
-
[quote author="Zlatomir" date="1292321980"]When you can't rebuild Qt installed with the SDK, you can download just the Qt sources and static build the sources (and you can have both versions of Qt installed)[/quote]Ah, okay thanks. Will give that a go :)
-
[quote author="stuk" date="1292320967"]You want build static qt for a closed project? Remember static qt can't use in LGPL application.[/quote]Nope, Qt is being used in an Open Source application under the GNU GPL license so my assumption that it is okay unless you wish to correct my understanding ?
-
Ok, static for GPL is enable :) Great!
[quote author="uxbod" date="1292328452"][quote author="stuk" date="1292320967"]You want build static qt for a closed project? Remember static qt can't use in LGPL application.[/quote]Nope, Qt is being used in an Open Source application under the GNU GPL license so my assumption that it is okay unless you wish to correct my understanding ?[/quote]
-
Check out this link:
http://bugreports.qt.nokia.com/browse/QTBUG-13767
Patches were submitted, but they were never applied. (Perhaps the patches break a non-static build?)
-
I'm new to QT so take that with a grain of salt. Here's how I got the darned thing to appropriately run configure.
I'm using QT4.7.0 on WinXP Sp3
Create a user variable:
QMAKESPEC = "win32-g++"
Create mingw_home user variable:
MINGW_HOME = "c:\qt\2010.05\mingw" <-- NO BACKSLASH!!!
Add the mingw variable to my user path:
Path = "...;%MINGW_HOME%\bin;"
(For whatever reason the post isn't placing my percent signs in front and behind my MINGW_HOME variable.)
Then restart my command prompt and run config -static inside the "c:\qt\2010.05\qt" folder.Ultimately, the ming32-make fails with the message "undefined reference to
_imp_Z...
. I'm going to try compiling from sources instead. I'll give more feedback later.
I hope this helps someone.