Originally Posted by alan99
gcc will just compile it to object code. I think he forgot the next step. It must be linked. The linker will insert some 'headers' in the object file telling the operating system where to find the entry point for the code and any parameters it may be passing.
No, running gcc as shown by the OP will do both the compiling and linking. If you just want the code to be compiled, you must use the -c flag.