undefined reference to `main'

Kai Ruottu kai.ruottu@wippies.com
Wed Jul 1 14:12:00 GMT 2009


vinod wrote:

> When I using gcc to compile my code.c to code , I got the error msg as
> follows :
> /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crt1.o: In function
> `_start':
> (.text+0x18): undefined reference to `main'
> collect2: ld returned 1 exit status
> 
> What can I do now, any suggestion?

Please read the book :

http://www.crasseux.com/books/ctut.pdf

also a manual for glibc, GCC etc. could be useful in your own library...
Or reading them online. Like :

http://www.gnu.org/software/libc/manual/



More information about the Gcc-help mailing list