Fixing Static Building of Qt SDK 4.7.1 or later, under Windows
Hi to all.
Static Building of Qt SDK, versions 4.7.1 and later, as described in http://doc.trolltech.com/4.7.1/deployment-windows.html#static-linking , is not working.
It works OK, for Qt SDK up to version 4.7.0, which is the one I am using, because of this.
Are there any plans for fixing it?
12 replies
What exactly fails? Have you filed a bug report [bugreports.qt.nokia.com] ? If this is indeed a bug, then mentioning it in the forum will not get it fixed!
I strongly recommend to build your static Qt libs not from the SDK but from the vanilla source tarball.
Be careful to take the .zip file and not the .tar.gz since you are running on windows. The versions differ only by line endings, but the configure script will complain in a cryptic way when you pick the wrong package.
I built a static 4.7.3 from the sources using VS2008 on a 64-bit Windows 7 machine without any problems. If you’re using shadow building, it’s probably a good idea to skip the examples, though (using the -nomake examples configure option). Shadow building is nice, because it lets you build all your different builds from the same source tree – and whenever a build fails, you can start it over again without having to unpack a fresh source tree again.
1. I installed Qt SDK 4.7.3 to its default directory C:\QtSDK.
2. Extracted the vanilla sources of Qt Library 4.7.3 (http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.3.zip) to
C:\qt-everywhere-opensource-src-4.7.3
3. I ran the Qt Command Prompt (with “Run as Administrator” option),
and cded to C:\qt-everywhere-opensource-src-4.7.3
4. configure -static -release -platform win32-g++ -nomake examples
succeeded.
5. mingw32-make was building without problem for about 3 hours, when it failed with these messages:
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:\qt-everywhere-opensource-src-4.7.3\lib” -L“c:\q
t-everywhere-opensource-src-4.7.3\lib” -lmingw32 -lqtmain -lQtDeclarative -lQtOp
enGL -lQtScript -lQtSvg -lQtSql -lQtXmlPatterns -lglu32 -lopengl32 -lQtGui -lgdi
32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 -lQtNetwork -lQtCo
re -lkernel32 -luser32 -lshell32 -luuid -lole32 -ladvapi32 -lws2_32
c:\qt-everywhere-opensource-src-4.7.3\lib/libQtOpenGL.a(qpaintengineex_opengl2.o
):qpaintengineex_opengl2.cpp:(.text+0×11c0): undefined reference to `_imp___Z16q
t_imageForBrushib’
c:\qt-everywhere-opensource-src-4.7.3\lib/libQtOpenGL.a(qpaintengine_opengl.o):q
paintengine_opengl.cpp:(.text+0xacda): undefined reference to `_imp___Z16qt_imag
eForBrushib’
c:\qt-everywhere-opensource-src-4.7.3\lib/libQtOpenGL.a(qpixmapdata_gl.o):qpixma
pdata_gl.cpp:(.text+0xcd): undefined reference to `_imp___Z14qt_defaultDpiXv’
c:\qt-everywhere-opensource-src-4.7.3\lib/libQtOpenGL.a(qpixmapdata_gl.o):qpixma
pdata_gl.cpp:(.text+0xe1): undefined reference to `_imp___Z14qt_defaultDpiYv’
c:\qt-everywhere-opensource-src-4.7.3\lib/libQtOpenGL.a(qpixmapdata_gl.o):qpixma
pdata_gl.cpp:(.text+0xfa): undefined reference to `_imp___Z14qt_defaultDpiYv’
c:\qt-everywhere-opensource-src-4.7.3\lib/libQtOpenGL.a(qpixmapdata_gl.o):qpixma
pdata_gl.cpp:(.text+0×13a): undefined reference to `_imp___Z14qt_defaultDpiXv’
c:\qt-everywhere-opensource-src-4.7.3\lib/libQtOpenGL.a(qglpixmapfilter.o):qglpi
xmapfilter.cpp:(.text+0×1842): undefined reference to `_imp___Z13qt_halfScaledRK
6QImage’
c:\qt-everywhere-opensource-src-4.7.3\lib/libQtOpenGL.a(qglpixmapfilter.o):qglpi
xmapfilter.cpp:(.text+0×1b3b): undefined reference to `_imp___Z13qt_halfScaledRK
6QImage’
c:\qt-everywhere-opensource-src-4.7.3\lib/libQtOpenGL.a(qglpixmapfilter.o):qglpi
xmapfilter.cpp:(.text+0×1e19): undefined reference to `_imp___Z12qt_blurImageR6Q
Imagedbi’
c:\qt-everywhere-opensource-src-4.7.3\lib/libQtOpenGL.a(qglpixmapfilter.o):qglpi
xmapfilter.cpp:(.text+0×26ff): undefined reference to `_imp___Z12qt_blurImageR6Q
Imagedbi’
c:\qt-everywhere-opensource-src-4.7.3\lib/libQtOpenGL.a(qglpixmapfilter.o):qglpi
xmapfilter.cpp:(.text+0×2e1e): undefined reference to `_imp___Z13qt_halfScaledRK
6QImage’
c:\qt-everywhere-opensource-src-4.7.3\lib/libQtOpenGL.a(qglpixmapfilter.o):qglpi
xmapfilter.cpp:(.text+0×2efc): undefined reference to `_imp___Z17qt_memrotate90_
glPKjiiiPji’
c:\qt-everywhere-opensource-src-4.7.3\lib/libQtOpenGL.a(qglframebufferobject.o):
qglframebufferobject.cpp:(.text+0×53f): undefined reference to `_imp___Z14qt_def
aultDpiXv’
c:\qt-everywhere-opensource-src-4.7.3\lib/libQtOpenGL.a(qglframebufferobject.o):
qglframebufferobject.cpp:(.text+0×569): undefined reference to `_imp___Z14qt_def
aultDpiYv’
c:\qt-everywhere-opensource-src-4.7.3\lib/libQtOpenGL.a(qglpixelbuffer.o):qglpix
elbuffer.cpp:(.text+0×20b): undefined reference to `_imp___Z14qt_defaultDpiXv’
c:\qt-everywhere-opensource-src-4.7.3\lib/libQtOpenGL.a(qglpixelbuffer.o):qglpix
elbuffer.cpp:(.text+0×235): undefined reference to `_imp___Z14qt_defaultDpiYv’
collect2: ld returned 1 exit status
mingw32-make3: *** [..\..\bin\qmlviewer.exe] Error 1
mingw32-make3: Leaving directory `C:/qt-everywhere-opensource-src-4.7.3/tools/
qml’
mingw32-make2: *** [release] Error 2
mingw32-make2: Leaving directory `C:/qt-everywhere-opensource-src-4.7.3/tools/
qml’
mingw32-make1: *** [sub-qml-make_default-ordered] Error 2
mingw32-make1: Leaving directory `C:/qt-everywhere-opensource-src-4.7.3/tools’
mingw32-make: *** [sub-tools-make_default-ordered] Error 2
C:\qt-everywhere-opensource-src-4.7.3>
What am I doing wrong? Thank you a lot.
Hi,
There are some fixes for static building that didn’t make it into the 4.7.3 release. The patches are used by mingw-cross-env, a project focused on cross building static static libraries.
The project is here http://mingw-cross-env.nongnu.org/.
If you just want the patches, they are here:
http://hg.savannah.gnu.org/hgweb/mingw-cross-env/file/1de8581a1adf/src/qt-1-cherrypicks.patch
Mark
Hi,
I build teh static version of Qt 4.7.1 like in this described wiki article [developer.qt.nokia.com] . For me it worked with MinGW. The problem is that some modules do not support static building anymore without changing a bit. But afterwards it worked perfectly.
You must log in to post a reply. Not a member yet? Register here!






