This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Gcc cannot open .c file after creating object file
- From: Rick Mann <rmann at latencyzero dot com>
- To: "a,bug,free,life" <anilmutha at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 12 Oct 2007 15:07:54 -0700
- Subject: Re: Gcc cannot open .c file after creating object file
- References: <13183611.post@talk.nabble.com>
On Oct 12, 2007, at 2:49 PM, a,bug,free,life wrote:
Whenever i creat a .c file and execute it it changes the source
file to
binary file.
I tried with the program hello world.
It compiles it properly, but after the linker it overwrites the
source file
the command line prompt i used were
gcc -c ccc.c
gcc -0 ccc.c ccc.o
./ccc.o
I'm not sure, but if you mean -o (lower-case O) instead of -0 (zero),
then you've told GCC to output the resulting executable and name it
"ccc.c", replacing your original source file.
I don't know off the top of my head what -0 does, if anything.
--
Rick