使用gcc -v可以查看gcc的版本
gcc -v
Using built-in specs.
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.7-1ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --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 --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.4.7 (Ubuntu/Linaro 4.4.7-1ubuntu2)
查看/usr/lib/gcc/i686-linux-gnu下面有好多目录
drwxr-xr-x 4 root root 4096 Jan 22 14:19 4.4/
lrwxrwxrwx 1 root root 3 Apr 16 2012 4.4.6 -> 4.4/
lrwxrwxrwx 1 root root 3 Apr 16 2012 4.4.7 -> 4.4/
drwxr-xr-x 4 root root 4096 Jan 16 13:17 4.6/
lrwxrwxrwx 1 root root 3 Jan 16 11:52 4.6.3 -> 4.6/
如下,也就是安装了4.6和4.4版本的gcc编译器,
/usr/bin下面有个 gcc 和g++的链接,这里也改成4.4的。