root用户下安装gcc:sudo apt-get install gcc-4.4
sudo apt-get install g++-4.4
装完后进入/usr/bin目录下:cd /usr/bin
查看gcc:root@ubuntu:/usr/bin# ls -l gcc*
lrwxrwxrwx 1 root root 7 May 2 19:27 gcc -> gcc-4.8
-rwxr-xr-x 1 root root 255080 Mar 20 2014 gcc-4.4
-rwxr-xr-x 1 root root 357344 Mar 20 2014 gcc-4.6
-rwxr-xr-x 1 root root 775888 Jan 27 15:40 gcc-4.8
lrwxrwxrwx 1 root root 10 May 2 19:27 gcc-ar -> gcc-ar-4.8
-rwxr-xr-x 1 root root 26968 Jan 27 15:40 gcc-ar-4.8
lrwxrwxrwx 1 root root 10 May 2 19:27 gcc-nm -> gcc-nm-4.8
-rwxr-xr-x 1 root root 26968 Jan 27 15:40 gcc-nm-4.8
lrwxrwxrwx 1 root root 14 May 2 19:27 gcc-ranlib -> gcc-ranlib-4.8
-rwxr-xr-x 1 root root 26968 Jan 27 15:40 gcc-ranlib-4.8
发现gcc 链接到gcc-4.8, 须要将它改为链接到gcc-4.4:root@ubuntu:/usr/bin# sudo mv gcc gcc.bak
root@ubuntu:/usr/bin# sudo ln -s gcc-4.4 gcc
同理,查看g++:root@ubuntu:/usr/bin# ls -l g++*
lrwxrwxrwx 1 root root 7 Apr 8 2014 g++ -> g++-4.8
-rwxr-xr-x 1 root root 259176 Mar 20 2014 g++-4.4
-rwxr-xr-x 1 root root 775888 Jan 27 15:15 g++-4.8
发现g++链接到g++-4.8, 须要将它改为链接到g++-4.4:root@ubuntu:/usr/bin# sudo mv g++ g++.bak
root@ubuntu:/usr/bin# sudo ln -s g++-4.4 g++
最后查看gcc和g++版本号:root@ubuntu:/usr/bin# gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.7-8ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --disable-libmudflap --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.7 (Ubuntu/Linaro 4.4.7-8ubuntu1)root@ubuntu:/usr/bin# g++ -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.7-8ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --disable-libmudflap --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.7 (Ubuntu/Linaro 4.4.7-8ubuntu1)
版本均为4.4.7,降低版本成功。