This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: unreferenced main in embedded source code
- From: Georg-Johann Lay <avr at gjlay dot de>
- To: domenico margiotta <margiodo at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 20 Apr 2011 11:30:34 +0200
- Subject: Re: unreferenced main in embedded source code
- References: <BANLkTi=qXFys2bgyvwVbOdUmK-puiK5ALg@mail.gmail.com> <BANLkTimNB0xDA=yewEFzvuf320efR5m91Q@mail.gmail.com>
domenico margiotta schrieb:
> Hi everybody,
>
> i'm programming for embedded system and for work i use a code warrior
> ide (for freescale microprocessor).
>
> Our client has required to clean every warning in souce code. The
> codewarrior compiler don't detect every warning and so the client said
> to use a gcc -Wall and lint command.
>
> In our source code,we don't use a classic main(), but we specified at
> the IDE how is the main() and it compile fine, but when i run gcc
> -Wall, i reached the error for "undefined reference to `main' ".
This is a message from the linker, not from the compiler.
Presumably startup code jumps to main, which is quite reasonable for
Standard C/C++ programs :-)
Add -v -Wl,-v to the command line to see what's going on.
> Is it possible specify my entry point as main()?
>
> Best regarding,
> Domenico
>