ok, maybe it's not interesting if you know why, but if you don't it's really strange.
in c with gcc i wrote a program and included math.h
then complied the program
gcc mop.c -o mop.c
then guess what i get
collect2: ld returned 1 exit status
and wha-la the program is gone. even the one i saved. it's the vanishing program fault.
good thing it was a test program only 10 or so lines wrong.
what gives?
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
an interesting fault with gcc
Re: an interesting fault with gcc
Are you wanting to overwrite the source file with the output file?cyborg_o wrote:ok, maybe it's not interesting if you know why, but if you don't it's really strange.
in c with gcc i wrote a program and included math.h
then complied the program
gcc mop.c -o mop.c
then guess what i get
collect2: ld returned 1 exit status
and wha-la the program is gone. even the one i saved. it's the vanishing program fault.
good thing it was a test program only 10 or so lines wrong.
what gives?
Yes, the second "mop.c" should be just "mop", but are you sure that's what you typed when you compiled it? You typed it wrong in this forum post, you could have just as easily mistyped when you tried to compile, and overwrote the source in some way as you did so.
GCC may have created a temporary object (*.o) file before linking, failed to link because of a missing library, but overwritten mop.c before aborting with an error.
This is a good reason to always use makefiles, even one liners. I'd try again with another short test program, making very sure to output to a different file, and see if you get the same error.
GCC may have created a temporary object (*.o) file before linking, failed to link because of a missing library, but overwritten mop.c before aborting with an error.
This is a good reason to always use makefiles, even one liners. I'd try again with another short test program, making very sure to output to a different file, and see if you get the same error.