# [Tutorial] Compiling 4.0 in Ubuntu 11.10 (changing g++/gcc versions)



## Concistency (Nov 2, 2011)

As you guys know, Ubuntu 11.10 has gcc g++ v4.6.x, building Android 4.0 in Ubuntu 11.10 will require gcc g++ v4.4, This is a pretty BASIC tutorial, easy to follow.

I'm going to tell you how to change versions (downgrade)-

First thing is first, install gcc g++ if you don't already have it, most likely you do.

Now check the version-


```
<br />
gcc --version<br />
g++ --version<br />
```
The output should say 4.6.x

Once you have those installed, we will now install 4.4

All you have to do is "sudo apt-get install gcc-4.4" and "sudo apt-get install g++-4.4"

We will now link:


```
<br />
rm /usr/bin/gcc<br />
rm /usr/bin/g++<br />
ln -s /usr/bin/gcc-4.4 /usr/bin/gcc<br />
ln -s /usr/bin/g++-4.4 /usr/bin/g++<br />
```
You may have to restart the terminal, but after you do this, you should be able to run "gcc and g++ --version" and have version 4.4

After doing this and installing all the other necessary programs to build, I have no problems compiling ICS on 11.10.


----------



## XxNLGxX (Jul 9, 2011)

Good info! One thing I'll add is you'll have to be root do anything in the /usr folder.

Either:

```
<br />
su<br />
rm /usr/bin/gcc<br />
rm /usr/bin/g++<br />
ln -s /usr/bin/gcc-4.4 /usr/bin/gcc<br />
ln -s /usr/bin/g++-4.4 /usr/bin/g++<br />
```
or, if you like to type...Lol


```
<br />
sudo rm /usr/bin/gcc<br />
sudo rm /usr/bin/g++<br />
sudo ln -s /usr/bin/gcc-4.4 /usr/bin/gcc<br />
sudo ln -s /usr/bin/g++-4.4 /usr/bin/g++<br />
```


----------



## Concistency (Nov 2, 2011)

XxNLGxX said:


> Good info! One thing I'll add is you'll have to be root do anything in the /usr folder.
> 
> Either:
> 
> ...


Lol, thanks for the add, I didn't even think of adding that into the tutorial.


----------

