CentOS 6.6安装Qt5.4

时间:2021-03-07 23:12:55

原材料:qt-opensource-linux-x64-5.4.0.run + CentOS 6.6 + gcc4.8

1. Install Development Tools

yum groupinstall "Development Tools"
2. Install glibc-devel.i686 
yum install glibc-devel.i686
On Ubuntu it's called libc6-dev-i386-do 
On Red Hat distros, the package name is glibc-devel.i686 
On CentOS 5.8, the package name is glibc-devel.i386 
On CentOS 6 / 7, the package name is glibc-devel.i686.
On SLES it's called glibc-devel-32bit - do zypper in glibc-devel-32bit

3. Download and install GCC 4.8.2 or latest version.

cd gcc-4.8.2
./contrib/download_prerequisites
mkdir gcc-bulid-4.8.2
cd /gcc-build-4.8.2
../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
make -j4
make install

4. Copy new GCC libraries to /usr/lib64
mv /usr/lib64/libstdc+''.so.6 /usr/lib64/libstdc.so.6.backup
cp -f /usr/local/lib64/libstdc++.so libstdc++.so.6 libstdc++.so.6.0.18  /usr/lib64
ldconfig -v

5. Download and install Qt 5.4.0 or latest version
./qt-opensource-linux-x64-5.4.0.run
imagine that you install the qt in the /opt/Qt5.4.0/
6. install libGL lib
yum install libGL 
yum install libGL-devel

7. start the Qt:
cd /opt/Qt5.4.0/Tools/QtCreator/bin/
./qtcreator.sh