Install Qt4 and set the programming environment

Source: Internet
Author: User
Install Qt4 and set the programming environment-Linux general technology-Linux programming and kernel information. The following is a detailed description. I. Compilation and installation:

./Configure -- release-plugin-SQL-mysql-plugin-SQL-sqlite-plugin-SQL-odbc-plugin-SQL-psql

However, during running, it may prompt that you cannot test mysql or pgsql functions.
Therefore, you need to add the/etc/profile Environment

LD_LIBRARY_PATH =/usr/local/pgsql/lib:/usr/local/mysql/lib/mysql

You need to modify the src/plugins/sqldrivers/mysql. pro of Qt4 source code after configure. Add the following two lines at the beginning (you need to check the actual location of the system for the specific directory ).

Export depath + =/usr/local/mysql/include/mysql
LIBS + =-L/usr/local/mysql/lib/mysql

Pgsql is similar to the above changes to src/plugins/sqldrivers/mysql. pro

Export depath + =/usr/local/pgsql/include/server/usr/local/pgsql/include/internal
LIBS + =-L/usr/local/pgsql/lib

If the database is installed in/usr in this tutorial, it should be as follows:

INCLUDEPATH + =/usr/include/postgresql/server/usr/include/postgresql/internal/usr/include/postgresql/informix
LIBS + =-L/usr/lib/postgresql

Then run
./Configure -- release-plugin-SQL-mysql-plugin-SQL-sqlite-plugin-SQL-odbc-plugin-SQL-psql-continue
Make
Make install

You may find that the plug-in has not been installed. Go to src/plugins/sqldrivers/mysql and make; make install. Other database plug-ins are similar.

When compiling QT. /If no parameters are added during configure, QT4 compiles the release and debug Versions by default, so the Compilation Time is particularly long ,. /Add the -- release parameter to configure. in this way, compiling only one release can save more than half of the time.

Ii. Programming Environment Settings:

Compilation and installation are very time-consuming. You can directly install the ready-made rpm package. The everest tool disk is provided. You can also download the installation package at the following address:

Ftp://linux-ren.org/uploads/haulm/Qt-4.2


To avoid confusion between the Qt3.x and Qt4 learning environments used by the primary user (who often compile programs) during software compilation, it is best to create a dedicated user to learn Qt4 programming.

Create a new user and log on. Then add several lines to our shell configuration file. The bash configuration file is. bash_profile:

Run kwrite ~ /. Bash_profile

Add the following content:

PATH =/usr/lib/qt4/bin: $ PATH
Export PATH
QTDIR =/usr/lib/qt4/
Export QTDIR

Run the following command:

Cd/usr/bin

Ln-s/usr/lib/qt4/bin/qmake qmake4

Ln-s/usr/lib/qt4/bin/designer designer4

Ln-s/usr/lib/qt4/bin/assistant assistant4

Of course, if KDE4 desktop is used in the future, there will be no such troubles.

Run/usr/lib/qt4/bin/qtconfig and set the Font to Bitstream Charter in the Font item to exit. This prevents assistant4 from breaking down the document in bold.

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.