PDA

View Full Version : [ubuntu] How to install gcc



hmvartak
April 10th, 2010, 03:49 PM
How to install gcc?

I've Ubuntu 9.10. gcc version is 4.4

I've tried this code

sudo apt-cdrom add
sudo apt-get update
sudo apt-get install build-essentialBut no luck.

rtilson
April 10th, 2010, 05:07 PM
try sudo apt-get install gcc...or search for gcc in synaptic package manager

takisan
April 10th, 2010, 05:08 PM
What he said should work. I'd get both GCC and G++.

Sef
April 10th, 2010, 05:10 PM
How to install gcc?

I've Ubuntu 9.10. gcc version is 4.4

I've tried this code
Code:
sudo apt-cdrom add
sudo apt-get update
sudo apt-get install build-essential
But no luck.

That only works, if I remember correctly, if you use the alternate cd.


try sudo apt-get install gcc...or search for gcc in synaptic package manager

Not quite correct. One should update the repositories first, so one gets the most up-to-date applications.


sudo apt-get update && sudo apt-get install build-essential

partloer
April 10th, 2010, 05:15 PM
I think this should be install by default. You can check your version by


gcc --version

I think the latest version is 4.4.1

hmvartak
April 14th, 2010, 04:20 AM
My version is 4.4.1

Whenever I try to compile program I get this error.

http://img41.imageshack.us/img41/5373/screenshotdt.png

What else I need to do here?

lisati
April 14th, 2010, 04:24 AM
I think conio.h is an ms-dos file which you don't need in Ubuntu. (Someone else will probably correct me if I'm mistaken)

hmvartak
April 14th, 2010, 08:45 AM
Now it says unexpected "(".

http://img91.imageshack.us/img91/9625/screenshotos.png

lisati
April 14th, 2010, 08:50 AM
It would be better if you use copy and paste from your terminal, and wrap your code with
and .

Instead of running the program with sh, type the following in at the terminal:

./a.out

hmvartak
April 14th, 2010, 09:10 AM
It would be better if you use copy and paste from your terminal, and wrap your code with
and .

Instead of running the program with sh, type the following in at the terminal:

./a.out
Now it's working. Thanks!