July 10, 2011

Ioannis Vranos Ioannis Vranos
Lab Rat
16 posts

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

July 10, 2011

dialingo dialingo
Lab Rat
158 posts

Can you provide a link to an official statemant about static linking not working? Inside the link you mentioned I can not see a statement like this.

July 10, 2011

Ioannis Vranos Ioannis Vranos
Lab Rat
16 posts

I tried it myself and it failed, for Qt SDK >= 4.7.1, under Windows 7.

Qt SDK 4.7.0. builds OK.

Has it worked for you?

July 11, 2011

Tobias Hunger Tobias Hunger
Mad Scientist
3135 posts

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!

July 11, 2011

Volker Volker
Robot Herder
5428 posts

I strongly recommend to build your static Qt libs not from the SDK but from the vanilla source tarball. You can download it from the resources link on DevNet.

July 11, 2011

dialingo dialingo
Lab Rat
158 posts

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.

July 11, 2011

Ioannis Vranos Ioannis Vranos
Lab Rat
16 posts

Thanks fellows, I will give the vanilla sources of Qt 4.7.3 a try. :-)

July 11, 2011

ludde ludde
Ant Farmer
325 posts

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.

July 11, 2011

Ioannis Vranos Ioannis Vranos
Lab Rat
16 posts

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.

July 12, 2011

mabrand mabrand
Lab Rat
10 posts

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

July 25, 2011

volgh volgh
Lab Rat
2 posts

Hi Mark,

I am having same issue as Ioannis Vranos, I am using QT SDK 3.7.3. How do I apply the patches you mentioned?

Thanks!

July 25, 2011

Gerolf Gerolf
Area 51 Engineer
3210 posts

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.

 Signature 

Nokia Certified Qt Specialist.
Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

July 25, 2011

volgh volgh
Lab Rat
2 posts

Gerolf,

In the editing config files are you suppose to add the bold lines in or replace the existing lines in the config files? Also, what does the “…” in “LFLAGS = -static -static-libgcc …” mean, is to represent that there should something after it?

Thanks

 
  ‹‹ Play sound in ubuntu linux suggestion      Communications over Wi-Fi ››

You must log in to post a reply. Not a member yet? Register here!