Download address: http://download.qt.io/archive/qt/4.8/4.8.6/
Download package: qt - everywhere - opensource - SRC - 4.8.6. Tar. Gz
step 2: extract the compressed package in a suitable position
# tar XZVF qt - everywhere - opensource - SRC - 4.8.6. Tar. Gz
step 3: enter the corresponding directory
# CD/root/downloads/qt//absolute path//
step 4: to compile files
//note: our computer system is a 64 - bit, but because you want to run a 32-bit program, so need to compile the 32-bit under a 64 - bit system environment//
#./configure -- help//help document (* as the default installation options, can choose according to individual demand)//
Because we need to choose to install the version number, so choose - platform options, then to find what you need configuration document, and how to choose, different versions of QT configuration information under the folder mkspecs file, as shown in figure:
Figure in the selected version is we have to configure the name, Linux - g + + - 32, if it is need to install other versions, can choose the corresponding version
#./configure - platform Linux - g + + - 32 - fontconfig
//need to pay attention to here, because it is configuration is different from the version of the system, and in the process, it may due to different system files originally generated file is not generated by default
//need to adjust according to the result of personal runtime given, in order to avoid subsequent problems when using the
//here I use the fontconfig, because after the installation of qt does not support Chinese, so the subsequent installation again several times, new Suggestions in the installation for the first time to see, to avoid duplication operations//
listed several possible problems on the way here:
1. Lack of libX related library
# yum install libX *. I686
//because of what we need is a 32-bit qt, so attention should be paid to download the 32-bit download with various libraries//
2. Fontconfig support always be enabled due to functionality tests!
Due to we added fontconfig options, so this problem may occur, the lack of corresponding library, installation can
# yum install fontconfig *. I686
But after the operation is still the same error, it is because the freetype system is 64 - bit, not a 32-bit, install the corresponding 32-bit file good
# yum install freetype *. I686
all in all, the problem basically belongs to the lack of corresponding 32-bit library, after all, is a 64 - bit system, not to bring a 32-bit library file is normal, according to the error downloading and installing, can be in in the process of./configure -v to display specific error messages, add after
step 5: configure the make & amp; & It is good to make install
This process is time-consuming, about two or three hours, watching a movie or relax and let him run, installed after the default installation directory for the
/usr/local/trolltech/QT4.8.6
step 6: configure the environment variables
# vi/etc/profile
/* added at the end of the file:
Export QTDIR=/usr/local/Trolltech/Qt - 4.8.6
The export PATH=$QTDIR/bin: $PATH
Export MANPATH=$QTDIR/man: $MANPAT
Export export LD_LIBRARY_PATH=$QTDIR/lib: $LD_LIBRARY_PATH
After: wq exit */
# source/etc/profile
//the environment variable configuration take effect immediately//
so our whole QT installation is complete, can under a 64 - bit system, we run a 32-bit program, other source is installed in the system, the principle of similar, able to understand to install,