This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: undefined reference to `main'
- From: Kai Ruottu <kai dot ruottu at wippies dot com>
- To: vinod <vinod dot nanjaiah at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Wed, 01 Jul 2009 17:06:54 +0300
- Subject: Re: undefined reference to `main'
- References: <4a4b5f7b.1c05d00a.15ec.7f82@mx.google.com>
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
Could it be possible that you haven't the function 'main()' in your C
application ?
Maybe the current C courses and books teach that "C programs always
start from WinMain()"... :)