Linux Newbie help
 help / color / mirror / Atom feed
* gcc
@ 2002-06-26  7:33 Sridhar J (june end)
  2002-06-26  7:48 ` gcc Joseph Jackson
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Sridhar J (june end) @ 2002-06-26  7:33 UTC (permalink / raw)
  To: linux-newbie

Hello

When I compile a C program using gcc, I get an a.out file. But when I type
a.out, the error is "No such command"

How do I execute the file?

Regards
Sridhar
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: gcc
  2002-06-26  7:33 gcc Sridhar J (june end)
@ 2002-06-26  7:48 ` Joseph Jackson
  2002-06-26  8:07 ` gcc Kilaru Sambaiah
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Joseph Jackson @ 2002-06-26  7:48 UTC (permalink / raw)
  To: Sridhar J (june end); +Cc: linux-newbie



Sridhar J (june end) wrote:

> Hello
> 
> When I compile a C program using gcc, I get an a.out file. But when I type
> a.out, the error is "No such command"
> 
> How do I execute the file?
> 
> Regards
> Sridhar
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs
> 
> 


Well what kind of file are you tring to compile? most of the time if you are 
tring to compile a single source file it will be named program.c to compile it 
do this
gcc program.c -o program
it tells gcc to compile program.c and that the output should be called program
which will be the binary version of that file. See how that works out for ya.



-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: gcc
  2002-06-26  7:33 gcc Sridhar J (june end)
  2002-06-26  7:48 ` gcc Joseph Jackson
@ 2002-06-26  8:07 ` Kilaru Sambaiah
  2002-06-26 13:52   ` gcc Elias Athanasopoulos
  2002-06-26 12:25 ` gcc Mark Gallagher
  2002-06-26 12:34 ` gcc Szekely-Benczedi Endre
  3 siblings, 1 reply; 6+ messages in thread
From: Kilaru Sambaiah @ 2002-06-26  8:07 UTC (permalink / raw)
  To: Sridhar J (june end), linux-newbie

On Wednesday 26 June 2002 01:03 pm, Sridhar J (june end) wrote:
> Hello
>
> When I compile a C program using gcc, I get an a.out file. But when I type
> a.out, the error is "No such command"
>
> How do I execute the file?
>
> Regards
> Sridhar
> -

pwd is not in your path. Add it. otherwise type ./a.out
sam
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: gcc
  2002-06-26  7:33 gcc Sridhar J (june end)
  2002-06-26  7:48 ` gcc Joseph Jackson
  2002-06-26  8:07 ` gcc Kilaru Sambaiah
@ 2002-06-26 12:25 ` Mark Gallagher
  2002-06-26 12:34 ` gcc Szekely-Benczedi Endre
  3 siblings, 0 replies; 6+ messages in thread
From: Mark Gallagher @ 2002-06-26 12:25 UTC (permalink / raw)
  To: Sridhar J (june end); +Cc: linux-newbie

Sridhar J (june end) wrote:
> Hello
> 
> When I compile a C program using gcc, I get an a.out file. But when I type
> a.out, the error is "No such command"
> 
> How do I execute the file?

When you type "a.out", Linux checks the various "path" directories (e.g. 
"/usr/bin") for a file named "a.out".  If it can't find it, then it 
tells you that, well, it can't find it - that the command doesn't exist :o).

You can get around this by typing the exact path of the program.  Say 
a.out is located in "/home/sridhar/".  You can type "~/a.out" (from 
anywhere), or change to your home directory and type "./a.out".



-- 
Mark Gallagher
http://cyberfuddle.com/infinitebabble/




-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: gcc
  2002-06-26  7:33 gcc Sridhar J (june end)
                   ` (2 preceding siblings ...)
  2002-06-26 12:25 ` gcc Mark Gallagher
@ 2002-06-26 12:34 ` Szekely-Benczedi Endre
  3 siblings, 0 replies; 6+ messages in thread
From: Szekely-Benczedi Endre @ 2002-06-26 12:34 UTC (permalink / raw)
  To: Sridhar J (june end); +Cc: linux-newbie

./a.out maybe? To be sure you try to run it from the current
directory. I think your PATH environment varianle doesn't contains
the "." (current) directory...

Szekely-Benczedi Endre
-sysadmin
"Petru Maior" University
Targu Mures, Romania

On Wed, 26 Jun 2002, Sridhar J (june end) wrote:

> Hello
> 
> When I compile a C program using gcc, I get an a.out file. But when I type
> a.out, the error is "No such command"
> 
> How do I execute the file?
> 
> Regards
> Sridhar
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs
> 

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: gcc
  2002-06-26  8:07 ` gcc Kilaru Sambaiah
@ 2002-06-26 13:52   ` Elias Athanasopoulos
  0 siblings, 0 replies; 6+ messages in thread
From: Elias Athanasopoulos @ 2002-06-26 13:52 UTC (permalink / raw)
  To: usamki01; +Cc: Sridhar J (june end), linux-newbie

On Wed, Jun 26, 2002 at 01:37:16PM +0530, Kilaru Sambaiah wrote:
> On Wednesday 26 June 2002 01:03 pm, Sridhar J (june end) wrote:
> > Hello
> >
> > When I compile a C program using gcc, I get an a.out file. But when I type
> > a.out, the error is "No such command"
>
> pwd is not in your path. Add it. otherwise type ./a.out
> sam

Better do the the second. Adding the current directory to PATH can
cause security problems.

Elias

-- 
http://gnewtellium.sourceforge.net			MP3 is not a crime.	
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-06-26 13:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-26  7:33 gcc Sridhar J (june end)
2002-06-26  7:48 ` gcc Joseph Jackson
2002-06-26  8:07 ` gcc Kilaru Sambaiah
2002-06-26 13:52   ` gcc Elias Athanasopoulos
2002-06-26 12:25 ` gcc Mark Gallagher
2002-06-26 12:34 ` gcc Szekely-Benczedi Endre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox