This tutorial is not written from scratch. I would like to thank all people who
enlightened me about Linux and Open source. This tutorial acknowledges the
help of Ubuntu Community (Docs) and people at online forums who cleared
my doubts on compilers.
Installing compilers is one of the easiest things there out at Linux. It
may seem a bit tough and complicated in the beginning but apt-get
and Synaptic Package Manager simplify your work a lot. As a newbie
developer you would require a C/C++ and a Java compiler. Installing
them is a matter of few commands.
The GNU C and GNU C++ Compiler:
The GNU C compiler is also called gcc and C++ is called g++. You
may also require the GNU make utility. All of them can get installed
by getting the build-essential package.
Just use this command:
sudo apt-get install build-essential
The GNU Java Compiler:
Firstly note that this compiler is not the one provided by Sun. The GNU
Java compiler is named as gcj. Just install the package gcj
To install the GNU Java bytecode interpreter, install the gij package.
To have gcj compile to executables, install libgcj6-dev
Use the command:
sudo apt-get install gcj gij libgcj6-dev
UPDATE ON 10th July,2006:
Some people complain that the above method does not work on their system. Errors like “build-essential not found” are displayed. Here is an alternate way of doing the same:
Most people want to use linux in GUI mode just like windows. If this the case then why use the terminal? Just open the Synaptic Package Manager and search for the package gcc. Select the package, some more packages will be highlighted and will be asked to also be included in the install process. These are dependencies. Select them also and click on Apply. The packages are download and installed. To install g++,make and gcj just do the same as above mentioned for gcc package.
Well its done, now try compiling, it should work.




15 Comments
June 25, 2007 at 5:18 AM
i typed the command sudo apt-get install built-essential and the system responded with an error ” couldnt find package built-essential” plz help
June 27, 2007 at 10:36 PM
I suggest you to install it via synaptics package manager, in synaptics just search the package gcc, all the dependecies will be shown and you will be asked to download these also….
After doing the above steps, try downloading g++ which is the C++ compiler for linux,its always better to install packages via Synaptics if you are not very confident as it gives you all the dependencies also….
Hope you have an active internet connection,its required…
July 11, 2007 at 6:46 PM
Perhaps you’re getting errors because of the typo – it’s build-essential, not built-essential.
July 11, 2007 at 7:21 PM
@Daniel
Thanks, it was a typing mistake, corrected it…
September 9, 2008 at 10:40 AM
Hi
I dont have internet connection is there any way i can install build essential. I am really in need please help.
September 9, 2008 at 6:26 PM
build-essential is there in the CD. Just put in the install CD and install it from there.
February 24, 2009 at 11:48 AM
This is all i need.Thank you very much Sir.
Can you tell me more about the packages,i mean i want to download the packages with a .deb extension & want to install it latter manually from the terminal.How can I do so?
Please help…
February 24, 2009 at 4:39 PM
I dont suggest you to get a .deb package and install manually.
Manual installation is a pain as most of the packages have dependencies which are difficult to track down manually. Use the package manager and it does everything for you
March 9, 2009 at 12:45 AM
i am not able to install even 1 package yet.all the package installations give an error saying unable to connect to the website while i have a net connection what shud i do?
March 10, 2009 at 12:46 AM
Chandra,
Are you behind a proxy? This problem comes when you are behind a proxy, even though internet may be fine, Apt must know about the proxy server.
March 19, 2009 at 6:55 PM
ITS NICE one
March 22, 2009 at 8:24 AM
i want to install gcc, but i didn’t have connection internet.How i can…Please Help me
March 22, 2009 at 4:36 PM
Put in the Ubuntu CD in the tray, Goto System>Administration>Software Sources and select CD. Click on Close, it would ask you to reload the index. Click “Reload”
Now goto synaptic package manager and select “build-essential” package and its done.
May 3, 2009 at 1:42 PM
I went to Synopsis Pckg Mngr and did the same you said above to install gcc compiler but still when I go to terminal andtype gcc it says “no input files”
What is wrong?
Thanks
May 3, 2009 at 1:49 PM
You need to use gcc with filenames are input, gcc isnt a GUI compiler.
Use it like this
gcc inputfile.c -o outputfile
then execute it:
./outputfile
Example:
gcc server.c – o server
./server