- Download the source installer, http://download.qt.io/archive/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz
- Extract
- CD into the unpacked directory, command
./configure-static-release-opensource-qt-zlib-qt-libpng-qt-libmng-qt-libjpeg-nomake Demos-nomake Examples-qt-sql -sqlite-prefix/usr/local/trolltech/qt-4.8.6_static
The command parameter meanings are as follows (the default option with the + sign):
-static ....... Create and use static Qt libraries.-opensource ..... Compile and link the open-source Edition of Qt.-release ..... Compile and link Qt with debugging turned off. The third party libraries:-qt-zlib ..... Use the zlib bundled with qt.+-system-zlib .... Use zlib from the operating system. See Http://www.gzip.org/zlib-no-gif ....... Do not compile GIF reading Support.-no-libtiff ..... Do not compile TIFF support.-qt-libtiff ..... Use the Libtiff bundled with qt.+-system-libtiff .... Use Libtiff from the operating system. See Http://www.libtiff.org-no-libpng ..... Do not compile PNG support.-qt-libpng ..... Use the libpng bundled with qt.+-system-libpng ..... Use libpng from the operating system. See http://www.libpng.org/pub/png-no-libmng ..... Do not compile MNG support.-qt-libmng ..... Use the LIBMNG bundled with qt.+-system-libmng ..... Use LIBMNG from the operating system. See Http://www.libmng.com-no-libjpeg ... Do not Compile JPEG support.-qt-libjpeg ..... Use the Libjpeg bundled with qt.+-system-libjpeg .... Use Libjpeg from the operating system. See http://www.ijg.org-no-sql-<driver> ... Disable SQL <driver> entirely.-qt-sql-<driver> ... Enable a SQL <driver> in the Qtsql library, by Defaultnone is turned on.-plugin-sql-<driver> enable SQL <d River> as a plugin to is linked to at run time. Possible values for <driver>:[DB2 ibase MySQL OCI ODBC psql sqlite sqlite2 sqlite_symbian symsql TDs]-prefix <d Ir> ... This would install everything relative to <dir> (default/usr/local/trolltech/qt-4.8.6_static)
Make time is still so long ...
In the parameters of the Configure command, the following error occurs when no-qt-sql-sqlite is added.
Had to re-configure.
Main.cpp: (. text.startup+0x1dd6): Undefined reference to ' qt_plugin_instance_qsqlite () ' Collect2:ld return to 1MAKE[4]: * * * [.. /.. /.. /.. /bin/assistant] Error 1make[4]: Leaving directory '/media/software/qtres/qt-everywhere-opensource-src-4.8.6/tools/assistant/ Tools/assistant ' make[3]: * * [sub-assistant-make_default-ordered] Error 2make[3]: Leaving directory '/media/software/qtres/ Qt-everywhere-opensource-src-4.8.6/tools/assistant/tools ' make[2]: * * * [sub-tools-make_default-ordered] Error 2make[2] : Leaving directory '/media/software/qtres/qt-everywhere-opensource-src-4.8.6/tools/assistant ' make[1]: * * * [ Sub-assistant-make_default-ordered] Error 2make[1]: Leaving directory '/media/software/qtres/qt-everywhere-opensource-src-4.8.6/ Tools ' Make: * * [sub-tools-make_default-ordered] Error 2
If I want to add -qt-sql-mysql, does the display not succeed?
- Create a folder, and then write the program file main.cpp
- Qmake-project
- Add config + = static after generating pro file
- Qmake
- After generating makefile, insert-static after cxxflags =
- Make
QT4.8.6 Static Compilation