Ubuntu 12.04 gcc 4.4

Install GCC 4.4 on Ubuntu 12.04

First, install GCC 4.4

sudo apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib gcc-4.4-multilib

Set 4.4 to be the default
Then set 4.4 to be higher priority than 4.6:

sudo update-alternatives –install /usr/bin/g++ g++ /usr/bin/g++-4.4 100
sudo update-alternatives –install /usr/bin/g++ g++ /usr/bin/g++-4.6 50
sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-4.4 100
sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-4.6 50
sudo update-alternatives –install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.4 100
sudo update-alternatives –install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.6 50

Verify that it has worked:

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)



About xlcwu

Self-employed (One-man Company), Developer/Chief Designer/Consultant, Embedded Linux/NAS/Storage/Platform/Devices, Xcode/Cocos2D/Cocoa/Objective-C, at Joe’s Lab – Newland ESP (TM).
This entry was posted in Linux, Ubuntu. Bookmark the permalink.

One Response to Ubuntu 12.04 gcc 4.4

  1. Dave says:

    Thanks so much. You just saved me a bunch of time and hassle.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s