Re: why linker complains undefined reference to `main'?

From: James McIninch (james.mcininch.nospam_at_comcast.net)
Date: 04/01/05


To: "baumann.Pan@gmail.com" <baumann.Pan@gmail.com>
Date: Thu, 31 Mar 2005 23:47:54 -0500


<posted & mailed>

is main() defined in one of those files?

baumann.Pan@gmail.com wrote:

> Hi all,
> what's the problem? why ? thanks
> when I complile three c source file
> gcc -o prog prog.c additional1.c additonal2.c additional3.c -lpthread
> -DDEBUG -DXXX -DYYY ,
> the compiler generates the message :
> /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crt1.o(.text+0x18):
> In function `_start':
> ../sysdeps/i386/elf/start.S:77: undefined reference to `main'
> collect2: ld returned 1 exit status

-- 
Remove '.nospam' from e-mail address to reply by e-mail