LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Launching GCC.... (https://www.linuxquestions.org/questions/linux-newbie-8/launching-gcc-787603/)

junmuz 02-07-2010 11:30 AM

Launching GCC....
 
I am a beginner at the linux forums. I am unable to launch gcc through command terminal.I am using red hat platform. Can any 1 help me out.

switch10 02-07-2010 11:35 AM

it should just be:

Code:

gcc program.c
where "program.c" is your C program

are you getting some kind of error? Is GCC installed?

chrism01 02-07-2010 05:49 PM

rpm -qa |grep -i gcc

will show if its installed
http://kbase.redhat.com/faq/docs/DOC-2531

junmuz 02-08-2010 04:58 AM

@ chrism 01, I m getting this message when i have typed the command u told.

gcc-gfortran-4.1.2-46.el5
libgcc-4.1.2-46.el5
gcc44-c++-4.4.0-6.el5
gcc44-4.4.0-6.el5
gcc-4.1.2-46.el5
gcc-c++-4.1.2-46.el5

How can i execute the file, after compilation. What commands do i need to use to execute the file..

evo2 02-08-2010 05:06 AM

If you don't tell the compiler otherwise, it will create an executable called "a.out". You can compile and run with the following commands.
Code:

gcc program.c
./a.out

If you can I suggest you try to get your hands on a copy of "The C Programming Language" by Kernighan and Ritchie. This is covered in the first few pages.

Cheers,

Evo2.


All times are GMT -5. The time now is 08:57 AM.