LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problem with compiling a c program (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-compiling-a-c-program-597784/)

lifeafterdeath 11-07-2007 10:06 AM

problem with compiling a c program
 
I installed gcc in my suse 10 sp1. Just to give a try, I wrote a simple hello world program. I tried compiling it by giving

cc hello.c

It showed nothing. Then when I gave a.out it says

a.out: command not found.



Plz help me with this..

matthewg42 11-07-2007 10:10 AM

The compiler is called "gcc", not "cc", although there may be an symlink from cc to gcc. Probably the current working directory is not in the PATH, so you need to explicitly say "use a.out from the current directory", like this:
Code:

./a.out

lifeafterdeath 11-07-2007 10:16 AM

Thanx a lot. Worked like a charm. Thank you very much.


All times are GMT -5. The time now is 07:22 PM.