[En-Nut-Discussion] Beginners question

Harald Kipp harald.kipp at egnite.de
Fri Dec 17 13:56:55 CET 2004


Hi Jan,

The avr-gcc linker is one-pass only. Removing NutDhcpConfig()
removes dhcpc.o, which is inside libnutpro, from linking.
dhcpc.o references NutEventPostAsync(), which is in event.o,
which in turn is part of libnutos. Thus, at

  -lnutpro -lnutos !!! At this point !!!

event.o isn't linked. But libnutdev.a, which is the next
library scanned

   -lnutpro -lnutos -lnutdev !!! Now we are here !!!

NutEventPostAsync() is required. But libnutos.a is already
through.

Confused? Don't worry. Simply add -nutos a second time to
your Makefile:

LIBS =  $(LIBDIR)/nutinit.o -lnutpro -lnutos -lnutdev -lnutnet -lnutcrt -lnutos

Harald

At 12:52 17.12.2004 +0100, you wrote:
>Hi,
>Just starting with the AVR radio example, I had the following problem:
>As I want to connect with hard code IP in local network, I take out the
>NutDhcpConfig(). When I delete the second call of this function, compiling
>with WinAVR, I get the following errors of undef. ref. to an amount of
>functions. example:
>
>avr-gcc mnut03_mod3.o -mmcu=atmega128
>-Wl,--defsym=main=0,-Map=mnut03_mod3.map,--cref -L../../lib/gcc/atmega128
>../../lib/gcc/atmega128/nutinit.o -lnutpro -lnutos -lnutdev -lnutnet -lnutcrt
>-o mnut03_mod3.elf
>../../lib/gcc/atmega128\libnutdev.a(lanc111.o)(.text+0x392): In function
>`NicInterrupt':
>: undefined reference to `NutEventPostAsync'
>
>Why is that and
>where can the sourcecode of the library functions be found?




More information about the En-Nut-Discussion mailing list