The first time I got this error message was 8 years ago when I was “trainee” at Smar Industrial at Sertaozinho with my Friend Marcelo Barros.
Today compiling an ancient version of bluez I received this same error message:
…/usr/lib/crt1.o: In function `_start’:
(.text+0x30): undefined reference to `main’
collect2: ld returned 1 exit status
At that time we didn’t document the solution, but this is not late:
Just add it to your Makefile:
CFLAGS = -nostdlib