PDA

View Full Version : [ubuntu] Installed GNU C compiler but cannot find it anywhere



kiedis
March 11th, 2012, 11:35 AM
Hi.

I installed gcc-4.5 package via Synaptic Manager but I cannot find C compiler anywhere in my system. How should I launch C compiler?

Thanks

Cheesemill
March 11th, 2012, 11:40 AM
It's a text-based tool, it doesn't have a graphical interface.

Open a terminal and type

man gcc
for more info.

MG&TL
March 11th, 2012, 11:40 AM
GCC & co. (g++, gfortran, etc.) are all command-line compilers. That is, they do not have an interface, you launch them from the command-line.

Open a terminal, then cd to the folder with your C files. Then run:


gcc -o <name> <files>

Where <name> is what you want to call your executable, and <files> is your files.

kiedis
March 11th, 2012, 01:11 PM
thank you for your replies!

but I don't quite understand what should i type in the terminal in order to launch C compiler. I located "gcc" and "gcc-4.5" files under /user/bin but what's the use of it? I typed for example $ cd usr/bin/ gcc -0 but got bash: cd: usr/bin/: No such file or directory error.

do i need to move those files to some other directory or smth?

Cheesemill
March 11th, 2012, 01:28 PM
do i need to move those files to some other directory or smth?

No. Just follow MG&TL's instructions above.

Change directory to where the C files are that you wish to compile and type:

gcc -o <name> <files>