How to Configure Qt (4.3.2) Environment on Linux Operating System
Download the open-source package: qt-x11-opensource-src-4.3.2.tar.gz. Extract: gunzip qt-x11-opensource-src-4.3.2.tar.gz tar xvf qt-x11-opensource-src-4.3.2.tar. Run the script: enter the qt-x11-opensource-src-4.3.2 directory and input ./configure to run the shell script, which tests the current system's essential configuration for software installation.
Download the open-source package: qt-x11-opensource-src-4.3.2.tar.gz
Extract: gunzip qt-x11-opensource-src-4.3.2.tar.gz
tar xvf qt-x11-opensource-src-4.3.2.tar
Run the script: Enter the qt-x11-opensource-src-4.3.2 folder and input ./configure to run the shell script program, which tests essential configuration information of the current system for software installation.
Compile: gmake
Install: gmake install
Environment variables: Edit /etc/profile using vi, and append the following lines at the end of the file:
PATH=/usr/local/Trolltech/Qt-4.3.2/bin:$PATH
QTDIR=/usr/local/Trolltech/Qt-4.3.2
MANPATH=$QTDIR/man:$MANPATH
LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export PATH QTDIR MANPATH LD_LIBRARY_PATH
After rebooting, the configuration is complete. Write a simple HelloQt program to verify whether the setup was successful. Then run qmake -project to generate the project file, use qmake on the generated .pro file to produce the Makefile, and finally run make to generate the executable.
Notes:
- During the
gmakeprocess, errors may occur indicating thatkrb5.hcannot be found. To resolve this issue, execute the following commands:
ln -s /usr/kerberos/include/com_err.h /usr/include/com_err.h
ln -s /usr/kerberos/include/profile.h /usr/include/profile.h
ln -s /usr/kerberos/include/krb5.h /usr/include/krb5.h
- If Linux is installed on a virtual machine, it may appear that
mountcannot detect the Windows hard drive. To copy files between Linux and Windows file systems, first install VMware Tools: Virtual Machine -> Install VMware Tools; thencd /mnt/cdromand run the./vmware-install.plscript; finally, go to Virtual Machine -> Settings -> Options -> Shared Folders to create a shared folder (corresponding to/mnt/hgfsin Linux) for file exchange between Linux and Windows.
This article's URL: http://www.stuhack.com/linux/system/29753.html