unreferenced main in embedded source code
Steffen Dettmer
steffen.dettmer@googlemail.com
Wed Apr 20 17:25:00 GMT 2011
On Wed, Apr 20, 2011 at 10:38 AM, domenico margiotta <margiodo@gmail.com> wrote:
> 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' ".
[others already proposed to avoid linking by adding "-c"]
> Is it possible specify my entry point as main()?
Yes, of course:
gcc -Wall module.c -nostdlib -Wl,-efunctionname
should work as long as module.c defines the function "functionname".
oki,
Steffen
More information about the Gcc-help
mailing list