Question:
how can I compile a c program in Ubuntu 8.10 using gcc?
sawkarnandan
2009-06-24 20:32:56 UTC
I am using Ubuntu 8.10. I have written .c files in gedit and now m trying to compile them using gcc. but everytime i invoke the command [$ gcc first.c] or [$ gcc -Wall first.c -o first] i get the following error msg (in both cases):
gcc: first.c: no such file or directory
gcc: no input files

kinldy help...Am I doing something wrong? what needs to be changed?
Three answers:
sneezer0_0
2009-06-24 20:42:58 UTC
It sounds like your doing it right but your not navigated to the proper directory in the terminal. Type dir in the terminal and make sure you are in the right directory. If not then type "cd" then give one space then the directory name. Make sure the source file exists in the directory..

Try this. type:

gcc first.c -o program
Douglas M
2009-06-24 20:41:20 UTC
I think you're in the wrong directory. Try an 'ls' and see if first.c is there. If it is not, do 'cd /path/to/where/file/is' and THEN run the gcc. (note - the path to the file should be like /home/user/Desktop NOT /home/user/Desktop/first.c)
2016-11-02 06:17:51 UTC
Run: gcc --help which will coach you the command line params for gcc. In that checklist, you ought to locate: -o report place the output into report So attempt: gcc occasion.c -o occasion.exe Now you ought to have an occasion.exe report which you will run.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...