0
votes

I'm trying to compile Qt statically.

I download the source of Qt 4.8.5, edited the Qmake file in /mkspecs/win32-g++ to include -static at QMAKE_LFLAGS and ran "C:\Qt\qt-everywhere-opensource-src-4.8.5>configure -platform win32-g++ -static - release -no-exceptions"

which gave me:

Creating qmake...
g++ -c -oproject.o -O -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Ige
nerators/mac -Igenerators/symbian -Igenerators/integrity -IC:\Qt\qt-everywhere-o
pensource-src-4.8.5/include -IC:\Qt\qt-everywhere-opensource-src-4.8.5/include/Q
tCore -IC:\Qt\qt-everywhere-opensource-src-4.8.5/include -IC:\Qt\qt-everywhere-o
pensource-src-4.8.5/include/QtCore -IC:\Qt\qt-everywhere-opensource-src-4.8.5/sr
c/corelib/global -IC:\Qt\qt-everywhere-opensource-src-4.8.5/src/corelib/xml -IC:
\Qt\qt-everywhere-opensource-src-4.8.5/mkspecs/win32-g++ -IC:\Qt\qt-everywhere-o
pensource-src-4.8.5/tools/shared -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LI
TE_COMPONENT -DQT_NO_PCRE -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHA
VE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARI
ANT -DQT_NO_DATASTREAM -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT -DQMAKE_OPENSOU
RCE_EDITION project.cpp
process_begin: CreateProcess(NULL, g++ -c -oproject.o -O -I. -Igenerators -Igene
rators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian -Igenerator
s/integrity -IC:\Qt\qt-everywhere-opensource-src-4.8.5/include -IC:\Qt\qt-everyw
here-opensource-src-4.8.5/include/QtCore -IC:\Qt\qt-everywhere-opensource-src-4.
8.5/include -IC:\Qt\qt-everywhere-opensource-src-4.8.5/include/QtCore -IC:\Qt\qt
-everywhere-opensource-src-4.8.5/src/corelib/global -IC:\Qt\qt-everywhere-openso
urce-src-4.8.5/src/corelib/xml -IC:\Qt\qt-everywhere-opensource-src-4.8.5/mkspec
s/win32-g++ -IC:\Qt\qt-everywhere-opensource-src-4.8.5/tools/shared -DQT_NO_TEXT
CODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE -DQT_NODLL -DQT_NO_
STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREA
D -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_BOOTSTRAPPED -DQL
IBRARYINFO_EPOCROOT -DQMAKE_OPENSOURCE_EDITION project.cpp, ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make: *** [project.o] Error 2
del project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o option.o win
makefile.o projectgenerator.o property.o meta.o makefiledeps.o metamakefile.o xm
loutput.o pbuilder_pbx.o borland_bmake.o msvc_nmake.o msvc_vcproj.o msvc_vcxproj
.o msvc_objectmodel.o msbuild_objectmodel.o symmake.o initprojectdeploy_symbian.
o symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o gbuild.o
qbitarray.o qbuffer.o qbytearray.o qcryptographichash.o qvsnprintf.o qbytearraym
atcher.o qconfig.o qdatetime.o qdir.o qdiriterator.o qfile.o qtemporaryfile.o qf
ileinfo.o qabstractfileengine.o qfilesystementry.o qfilesystemengine.o qfilesyst
emengine_win.o qfilesystemiterator_win.o qfsfileengine.o qfsfileengine_iterator.
o qfsfileengine_win.o qglobal.o qhash.o qiodevice.o qlibraryinfo.o qlist.o qlink
edlist.o qlocale.o qlocale_tools.o qlocale_win.o qmalloc.o qmap.o qregexp.o qtex
tcodec.o qutfcodec.o qstring.o qstringlist.o qsystemerror.o qsystemlibrary.o qte
xtstream.o quuid.o qvector.o qsettings.o qsettings_win.o qvariant.o qmetatype.o
qxmlstream.o qxmlutils.o qnumeric.o
Could Not Find C:\Qt\qt-everywhere-opensource-src-4.8.5\qmake\project.o
g++ -c -oproject.o -O -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Ige
nerators/mac -Igenerators/symbian -Igenerators/integrity -IC:\Qt\qt-everywhere-o
pensource-src-4.8.5/include -IC:\Qt\qt-everywhere-opensource-src-4.8.5/include/Q
tCore -IC:\Qt\qt-everywhere-opensource-src-4.8.5/include -IC:\Qt\qt-everywhere-o
pensource-src-4.8.5/include/QtCore -IC:\Qt\qt-everywhere-opensource-src-4.8.5/sr
c/corelib/global -IC:\Qt\qt-everywhere-opensource-src-4.8.5/src/corelib/xml -IC:
\Qt\qt-everywhere-opensource-src-4.8.5/mkspecs/win32-g++ -IC:\Qt\qt-everywhere-o
pensource-src-4.8.5/tools/shared -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LI
TE_COMPONENT -DQT_NO_PCRE -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHA
VE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARI
ANT -DQT_NO_DATASTREAM -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT -DQMAKE_OPENSOU
RCE_EDITION project.cpp
process_begin: CreateProcess(NULL, g++ -c -oproject.o -O -I. -Igenerators -Igene
rators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian -Igenerator
s/integrity -IC:\Qt\qt-everywhere-opensource-src-4.8.5/include -IC:\Qt\qt-everyw
here-opensource-src-4.8.5/include/QtCore -IC:\Qt\qt-everywhere-opensource-src-4.
8.5/include -IC:\Qt\qt-everywhere-opensource-src-4.8.5/include/QtCore -IC:\Qt\qt
-everywhere-opensource-src-4.8.5/src/corelib/global -IC:\Qt\qt-everywhere-openso
urce-src-4.8.5/src/corelib/xml -IC:\Qt\qt-everywhere-opensource-src-4.8.5/mkspec
s/win32-g++ -IC:\Qt\qt-everywhere-opensource-src-4.8.5/tools/shared -DQT_NO_TEXT
CODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE -DQT_NODLL -DQT_NO_
STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREA
D -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_BOOTSTRAPPED -DQL
IBRARYINFO_EPOCROOT -DQMAKE_OPENSOURCE_EDITION project.cpp, ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make: *** [project.o] Error 2
Building qmake failed, return code 2
1
Ok the answer is that you need an old version of mingw:user1311627
Since you found a solution, you should put it as an answer and accept it.cgmb

1 Answers

0
votes

Ok the solution is that you need MingW 4.4 http://nosymbolfound.blogspot.co.uk/2012/12/since-until-now-qt-under-windows-is.html

I don't know why but it worked.