PDA

View Full Version : Qt 5.0.2 static buliding error



tangtao_xp
30th May 2013, 16:33
Hi,

My environment is:

win7 64bit sp1
src code: qt-everywhere-opensource-src-5.0.2.zip



Path = D:\Program Files\python3.3.2\;D:\Perl64\site\bin;D:\Perl64\bi n;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\ System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerSh ell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\ThinkPad\Bluetooth Software\;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;%ANT_HOME%\bin;%JAVA_HOME%\bi n;%JAVA_HOME%\jre\bin;D:\Program Files\MySQL\MySQL Server 5.5\bin;%JBOSS_HOME%\bin;D:\Program Files\TortoiseSVN\bin;%M2_HOME%\bin;D:\Qt\Qt5.0.1\ Tools\MinGW\bin;D:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin ;D:\Qt\qwt-6.1-rc3\setup\lib;C:\Program Files (x86)\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Progr am Files (x86)\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\


I had alreadly installed qt sdk (binary) at D:\Qt\Qt5.0.1\ , therefore, I used the default mingw in Qt5.0.1\mingw47_32 to complie the source code.



my configure cmd is:

configure.bat -confirm-license -opensource -platform win32-g++ -release -static -ltcg -c++11 -fast -prefix "D:\Qt\Qt5.0.2-rel-static" -accessibility -rtti -qt-sql-sqlite -qt-sql-odbc -plugin-sql-sqlite -plugin-sql-odbc -qt-zlib -qt-libpng -qt-libjpeg -audio-backend -nomake docs -opengl desktop -no-qml-debug -no-vcproj -no-dbus -nomake tests -nomake examples -nomake demos -qt-freetype

mingw32-make




error is:



F:/qt-everywhere-opensource-src-5.0.2/qtbase/plugins/platforms\libqwindows.a(qwindowswindow.o):qwindows window.cpp:(.text+0x1569): undefined reference to `QPlatformWindow::formatWindowTitle(QString const&, QString const&)'collect2.exe: error: ld returned 1 exit status
Makefile.Release:79: recipe for target 'F:\qt-everywhere-opensource-src-5.0.2\qtbase\bin\qmlscene.exe' failed
mingw32-make[4]: *** [F:\qt-everywhere-opensource-src-5.0.2\qtbase\bin\qmlscene.exe] Error 1
mingw32-make[4]: Leaving directory 'f:/qt-everywhere-opensource-src-5.0.2/qtdeclarative/tools/qmlscene'
Makefile:34: recipe for target 'release' failed
mingw32-make[3]: *** [release] Error 2
mingw32-make[3]: Leaving directory 'f:/qt-everywhere-opensource-src-5.0.2/qtdeclarative/tools/qmlscene'
Makefile:44: recipe for target 'sub-qmlscene-make_first' failed
mingw32-make[2]: *** [sub-qmlscene-make_first] Error 2
mingw32-make[2]: Leaving directory 'f:/qt-everywhere-opensource-src-5.0.2/qtdeclarative/tools'
Makefile:66: recipe for target 'sub-tools-make_first' failed
mingw32-make[1]: *** [sub-tools-make_first] Error 2
mingw32-make[1]: Leaving directory 'f:/qt-everywhere-opensource-src-5.0.2/qtdeclarative'
makefile:154: recipe for target 'module-qtdeclarative-make_first' failed
mingw32-make: *** [module-qtdeclarative-make_first] Error 2


I had blocked here for whole day, pls help me.

Thank you in advance.

Tang Tao

arekp
3rd June 2013, 05:20
Maybe it's not exactly answer to your question, becouse it is for compiling with msvc, not with MinGW, but it worked for me.

I had the same error when compiling with MinGW. After a whole day compiling with MinGW i switched to msvc and after some amount of time i compiled it succesfully. I managed to compile QT versions 4.7.0, 5.0.2 (downloaded from git) and 5.1 beta.

I followed strictly to this guide (note that starting with QT5 versions make configurations were moved to \qtbase folder):
http://blog.diplix.de/2011/08/23/qt-with-visual-studio-2010-and-static-linking/

Also when installing Visial Studio i put it in folder name without spaces (don't know if that was reason for not working earlier, becouse it wasn't the only thing that i changed in first succesful build, but it's not a bad idea).
The path was then:

C:\msvc10.0\VC\bin

So my configure options were

configure -static -debug-and-release -opensource -qt-sql-sqlite -platform win32-msvc2010 -nomake demos -nomake examples -nomake tests -opengl desktop

After installing everything and changing build configurations in Qt Creator i managed to compile statically all Qt libraries in one executable file but not Visual C++ runtime libraries ("could not find msvcr100.dll" error after launching app on different computer), despite building Qt statically with "-MT" option configuration in qmake.conf.
All then i had to do was adding following line in .pro file to include this library:

INCLUDEPATH += C:\msvc10.0\Common7\Packages\Debugger\X64\msvcr100 .dll

After that i can run app on different computer.

Hope that helps

tangtao_xp
3rd June 2013, 16:09
Hi, arekp

Thank you for your friendly help.

Actually, I passed the static compiling in another way:

- I do not use the standalone source code package published by Qt official website. I used the source code that carried with the 5.0.2 binary setup package.(select the full installation, source code will be in, for example, D:\Qt\Qt5.0.2\5.0.2\Src)

- I found that the code from the binary package is very easy to compile, and doesn't like the standalone code has so many strange error when compiling.

-----------------------------------------------------------

another question I had found in binary package code compiling: it does not provide qml2(qt quick 2) moudle.
pls refer to https://bugreports.qt-project.org/browse/QTBUG-28357

Does anyone got the problem soloved?


Thank you in advance.


Tang Tao

Shanemorris
25th June 2013, 11:40
May be some video tutorials for this could help to learn us more easily...If possible do share some blog or articles or the site which can be referred for learning purposes.