View Full Version : QT 4.7 BETA 2 won't compile static under windows 7

11th August 2010, 16:50
Guys, I need some guidance here... I'm trying to make my little program standalon (only exe file).. I've been reading and found that I have to compile Qt in static linking mode. Read a LOT about it, tried another as well many guides, but no one is good to me, always get compiler errors, and the only one time I've was able to compile Qt my program didn't compile and the compiler thrown and error with something about "ld returned exit status 1".

The thing is:
- 4.6.2 I couldn't get my program compiled
- 4.6.3 won't compile due to some bugs

after reading a little found that in 4.7* the bugs are fixed... So I've downloaded 4.7 and tried to compile it. but I've got some errors like this

*my file is: qt-win-opensource-4.7.0-beta2-mingw.exe

From, To, 4>::cast() [with From = QDeclarativeAbstractAnimation, To = QDeclarati
12: warning: control reaches end of non-void function
mingw32-make[2]: *** [tmp/obj/release_static/qdeclarativeutilmodule.o] Error 1
mingw32-make[2]: Leaving directory `C:/Qt/4.7.0-beta2/src/declarative'
mingw32-make[1]: *** [release] Error 2
mingw32-make[1]: Leaving directory `C:/Qt/4.7.0-beta2/src/declarative'
mingw32-make: *** [sub-declarative-make_default-ordered] Error 2

Changed the mkspecs file for mkspecs/win32-g++/mkspecs.conf

Added to QMAKE_LFLAGS -static AND -static-libgcc

My configure command was the next

configure -release -static -nomake examples -nomake demos -no-
exceptions -no-stl -no-rtti -no-qt3support -no-scripttools -no-openssl -no-openg
l -no-webkit -no-phonon -no-style-motif -no-style-cde -no-style-cleanlooks -no-s
tyle-plastique -no-sql-sqlite -platform win32-g++

and then


I need some guidance with the compiler... there are my doubts: I don't know if I'm using the correct version. I'm using this (http://tdm-gcc.tdragon.net/) as this guide (http://www.formortals.com/build-qt-static-small-microsoft-intel-gcc-compiler/) recommended.

Can anyone give me a hint on what I'm failing?

edit: BTW, I'm starting on C++ as well on Qt, so please, be patient to me :o

edit: 2, same with the package qt-everywhere-opensource-src-4.7.0-beta2.tar.gz and without the -static-libgcc on the qmake.conf file

16th August 2010, 08:41
What did you do so 4.6.2 and 4.6.3 are not suitable for you? 4.7 is still not stable and for a beginner, I suggest you start with a released version of Qt.