I. Static Qt Compilation: Recently, the project is to be transplanted to the Linux platform, so we need to re-compile Qt on Linux. 1. First configure some programs used to compile Qt, use the following command: sudoapt-getinstallbuild-essentiallibpcap0.8-devlibx11-devlibfreetype6-devlibavahi-gobject-devlibSM-devlibXrender-
I. Static compiling Qt:
Recently, the project has to be transplanted to the Linux platform, so we need to re-compile Qt on Linux.
1. First, configure the program to be used to compile Qt and run the following command:
Sudo apt-get install build-essential libpcap0.8-dev libx11-dev libfreetype6-dev libavahi-gobject-dev libSM-dev libXrender-dev libfontconfig-dev libXext-dev
2. then download the qt-everywhere-opensource-src-xxx.tar.gz source package from qtguan. Address: ftp://ftp.qt.nokia.com/qt/source/
3. Extract
4. Configure path: export PATH = "$ PATH:/usr/local/Trolltech/Qt-4.7.1/bin"
5. configure the configure:./configure-static -- debug-and-release-nomake demos-nomake examples-no-limits tions of Qt.
-Static is used to specify static compilation;
-Nomake demos is used to specify the demos directory that does not compile qt, and examples is also used;
6. make
7. make install
Ii. Set Environment Variables
1. Run the command gedit ~ /. Profile to edit the file. Add the following to the file:
Export QTDIR =/usr/local/Trolltech/Qt-4.7.4/* need to modify your Qt installation directory */
Export LD_LIBRARY_PATH = $ QTDIR/lib
Export PATH = $ PATH: $ QTDIR/bin
Save and close the file.
2. Run the command source ~ /. Profile.
In this way, you can use qmake in any directory.