Help making Qt 4.7 static
-
hey
i wrote an simple calculator with QT-GUI-Application. Everthing was fine, but when i start the calc.exe he want some dll's. so i read that i have to make my qt4 static to get an *.exe without dll's.
i follow the instruction at http://developer.qt.nokia.com/wiki/Build_Static_Qt_For_Windows_With_Gcc_Germanbut i get an error and dont know what to do know :(
@
c:\QT4\qt_static>mingw32-make.exe
cd src\tools\bootstrap\ && mingw32-make.exe
mingw32-make.exe[1]: Entering directoryc:/QT4/qt_static/src/tools/bootstrap' c:\QT4\qt_static\bin\qmake -spec ..\..\..\mkspecs\win32-g++ -o Makefile bootstra p.pro mingw32-make.exe[1]: Leaving directory
c:/QT4/qt_static/src/tools/bootstrap'
mingw32-make.exe[1]: Entering directoryc:/QT4/qt_static/src/tools/bootstrap' mingw32-make.exe -f Makefile.Release mingw32-make.exe[2]: Entering directory
c:/QT4/qt_static/src/tools/bootstrap'
g++ -c -Os -momit-leaf-frame-pointer -frtti -fno-exceptions -Wall -DQT_STATIC_BU
ILD -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_
ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQ
T_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD
-DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NODLL -I"......\include" -I
"......\include\QtCore" -I"......\include\QtXml" -I"....\3rdparty\zlib" -I"
......\mkspecs\win32-g++" -o tmp\obj\release_static\qisciicodec.o ....\coreli
b\codecs\qisciicodec.cpp
g++ -c -Os -momit-leaf-frame-pointer -frtti -fno-exceptions -Wall -DQT_STATIC_BU
ILD -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_
ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQ
T_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD
-DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NODLL -I"......\include" -I
"......\include\QtCore" -I"......\include\QtXml" -I"....\3rdparty\zlib" -I"
......\mkspecs\win32-g++" -o tmp\obj\release_static\qlatincodec.o ....\coreli
b\codecs\qlatincodec.cpp
g++ -c -Os -momit-leaf-frame-pointer -frtti -fno-exceptions -Wall -DQT_STATIC_BU
ILD -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_
ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQ
T_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD
-DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NODLL -I"......\include" -I
"......\include\QtCore" -I"......\include\QtXml" -I"....\3rdparty\zlib" -I"
......\mkspecs\win32-g++" -o tmp\obj\release_static\qsimplecodec.o ....\corel
ib\codecs\qsimplecodec.cpp
g++ -c -Os -momit-leaf-frame-pointer -frtti -fno-exceptions -Wall -DQT_STATIC_BU
ILD -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_
ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQ
T_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD
-DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NODLL -I"......\include" -I
"......\include\QtCore" -I"......\include\QtXml" -I"....\3rdparty\zlib" -I"
......\mkspecs\win32-g++" -o tmp\obj\release_static\qtextcodec.o ....\corelib
\codecs\qtextcodec.cpp
g++ -c -Os -momit-leaf-frame-pointer -frtti -fno-exceptions -Wall -DQT_STATIC_BU
ILD -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_
ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQ
T_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD
-DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NODLL -I"......\include" -I
"......\include\QtCore" -I"......\include\QtXml" -I"....\3rdparty\zlib" -I"
......\mkspecs\win32-g++" -o tmp\obj\release_static\qtsciicodec.o ....\coreli
b\codecs\qtsciicodec.cpp
g++ -c -Os -momit-leaf-frame-pointer -frtti -fno-exceptions -Wall -DQT_STATIC_BU
ILD -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_
ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQ
T_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD
-DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NODLL -I"......\include" -I
"......\include\QtCore" -I"......\include\QtXml" -I"....\3rdparty\zlib" -I"
......\mkspecs\win32-g++" -o tmp\obj\release_static\qutfcodec.o ....\corelib
codecs\qutfcodec.cpp
g++ -c -Os -momit-leaf-frame-pointer -frtti -fno-exceptions -Wall -DQT_STATIC_BU
ILD -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_
ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQ
T_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD
-DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NODLL -I"......\include" -I
"......\include\QtCore" -I"......\include\QtXml" -I"....\3rdparty\zlib" -I"
......\mkspecs\win32-g++" -o tmp\obj\release_static\qglobal.o ....\corelib\gl
obal\qglobal.cpp
....\corelib\global\qglobal.cpp: In static member function 'static QSysInfo::Wi
nVersion QSysInfo::windowsVersion()':
....\corelib\global\qglobal.cpp:1730: error: cannot convert 'OSVERSIONINFOW*' t
o '_OSVERSIONINFOA*' for argument '1' to 'BOOL GetVersionExA(_OSVERSIONINFOA*)'
....\corelib\global\qglobal.cpp: In function 'QString qt_error_string(int)':
....\corelib\global\qglobal.cpp:2128: error: cannot convert 'WCHAR*' to 'CHAR*'
for argument '5' to 'DWORD FormatMessageA(DWORD, const void*, DWORD, DWORD, CHA
R*, DWORD, char**)'
mingw32-make.exe[2]: *** [tmp/obj/release_static/qglobal.o] Error 1
mingw32-make.exe[2]: Leaving directoryc:/QT4/qt_static/src/tools/bootstrap' mingw32-make.exe[1]: *** [release] Error 2 mingw32-make.exe[1]: Leaving directory
c:/QT4/qt_static/src/tools/bootstrap'
mingw32-make.exe: *** [sub-tools-bootstrap-sub_src_target_ordered] Error 2
@
need some help
cant be that writing an application is easier then making the exe... -
This is linked to ascii versus unicode strings.
Windows API Postifixed by 'A' take ASCII strings whereas standard take WCHAR unicode strings.
=> if you look at the code of qglobal, it's using the standard function (e.g. FormatMessage and not FormatMessageA). As your compiler says explicitely you're using the 'A' version, most probably, a macro is somewhere aliasing it...
A quick search in standard v4.7.1 code doesn't show any of these occurrences, so it's either in your compiler (i don't have mingwin here) or related to your configure -
i have a simular problem. how did you fixed it??