AW: [En-Nut-Discussion] make problem
Oliver Schulz
Oliver.Schulz at bong.de
Fri Oct 17 14:27:28 CEST 2003
Hi Michal,
it's a little bit tricky to explain exactly what happens while linking the stuff (system init, startup file and so on...).
But the first point is, that you must add '--defsym=main=0' to the linker call. Please have a look at app/Makedefs at the definition of LDFLAGS:
LDFLAGS = $(MCFLAGS) -Wl,--defsym=main=0,-Map=$(PROJ).map,--cref -L$(LIBDIR)
Hope that helps,
Oliver.
-----Ursprüngliche Nachricht-----
Von: krakora [mailto:Michal.Krakora at e4t.cz]
Gesendet: Freitag, 17. Oktober 2003 12:44
An: en-nut-discussion at egnite.de
Betreff: [En-Nut-Discussion] make problem
Hi!
I'm trying to compile my first project "nutos.c" and my compiler (avr-gcc 3.3.1) gives me this error:
avr-gcc -g -Wall -O5 -mmcu=atmega128 -c -o nutos.o nutos.c
nutos.c: In function `NutAppMain':
nutos.c:40: warning: unused variable `i'
avr-gcc -g -Wall -O5 -mmcu=atmega128 -Wl,-Map,nutos.map -o nutos.elf nutos.o
c:\WinAVR\bin\..\lib\gcc-lib\avr\3.3.1\..\..\..\..\avr\lib\avr5\crtm128.o(.init9+0x0): undefined reference to `main'
make: *** [nutos.elf] Error 1
Can you help me?
I'm using WinAVR 20030913 tool set and Ethernut 3.3.0 under W2k.
Thank you for any answer.
Michal
More information about the En-Nut-Discussion
mailing list