[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: c programming in Linux



> When i write  a simple program "to print hello world" and issue a command 
> cc kunal.c no error is shown by systems and next command prompt appears.
> But when i try to run this program by issuing command a.out nothing is happening and system prompts bash : a.aout not found not such file or directory
>  like it is not recognizing that command.

This is probably the single most FAQ we get on this list (just after "how
do I get Linux to work with my SiS6215 display card").

The answer is, of course, that your current directory is not in the path
(which is good) and when you type a.out, the current directory isn't
searched. You must therefore tell the shell *where* a.out is located -
since it is the current directory, you type "./a.out". Alternatively, you
can type "~/a.out" (if it is located in your home directory) or
/full/path/to/program/a.out if it is located elsewhere.

Atul

p.s. I *wish* we could document such stuff on www.linux-india.org. If KD
doesn't have the time to do this, maybe someone else could take up the
responsibility?



- --------------------------------------------------------------------
For more information on Linux in India visit http://www.linux-india.org/
Linux India is NOT a forum for Microsoft/India/Pakistan/US/UK bashing.
Flame baits will not be tolerated.  If you can appreciate satire read
http://www.templetons.com/brad/emily.html

------------------------------