QT4.8.6 Static Compilation

Source: Internet
Author: User

    • 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

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?

    • sudo make install
    • Test:
    1. Create a folder, and then write the program file main.cpp
    2. Qmake-project
    3. Add config + = static after generating pro file
    4. Qmake
    5. After generating makefile, insert-static after cxxflags =
    6. Make

QT4.8.6 Static Compilation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.