# Help in installing gcc in ubuntu

Status
Not open for further replies.

##### Newbie level 6
Hi;
I am having some troubles in installing GCC . Actually i followed the instructions in this website :Installing the GNU tools (avr-gcc) for AVRs But I think after trying all the possible ways I reached to a dead end, I hope if someone can help me. I will explain what I did in details, because I am not sure where the error is:
so after creating the directories and specifying the Path (as mentioned in that website) I had to go to binutils folder to configure it but the following command :
Code:
../configure --target=avr --prefix=/usr/local/avr --program-prefix="avr-"
Code:
bash: ../configure: NO such file or directory
I don't know if what I did is right but I tried to remove a dot from(../configure) and then it worked correctly I guess.
After that I installed it with make and make install without any problems.

Now the problem appeared again in configuring gcc the following command did not work at first.
Code:
../configure --target=avr --prefix=/usr/local/avr --enable-language=c --program-prefix="avr-"
But after some search I downloaded gmp4.3.2 and mpfr 3.0.1, untared them and put them in the gcc folder under the names of gmp and mpfr. and I ran ./configure and make and make install in each folder.

After that the ../configure (mentioned earlier) command in the gcc folder worked and make file was created but the command make did not work and gave me the following error:

I also tried the following command:
Code:
sudo apt-get install build-essential
Can some one help me please?

#### srizbf

ission to create /usr/local/avr ?

#### flanello

Perhaps you can run
Code:
make distclean
as mentioned in the error message.

#### bluehole

##### Full Member level 6
GCC needs to compile on a separate directory you should pass a build dir kind of thing.

But Why not try CrossTool-NG ? it will take all your hassles and give you a cross compiler.

#### navenmou

##### Full Member level 4
Hii dude

Why didi you all that much of lengthy process...
just follow the below instructions for installing GCC

type

"sudo apt-get install gcc"

so once try it...

#### bluehole

##### Full Member level 6
Hii dude

type

"sudo apt-get install gcc"

so once try it...

Well The OP asked about gcc for AVR. So if your distribution HAS a gcc-avr then only you can use "apt-get".

Well you are very correct but ...:lol:

Status
Not open for further replies.