This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Gcc cannot open .c file after creating object file



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]