[En-Nut-Discussion] Multiple definition of free and malloc

Harald Kipp harald.kipp at egnite.de
Tue Jun 14 16:31:46 CEST 2005


I see. No, realloc is not yet available with Nut/OS.
If it's used, realloc from avr-libc is linked in. Possibly
they use the malloc in the same linker module and bang,
we have multiple mallocs.

For now, you can write your own realloc.

Be aware, that Nut/OS C++ support is limited. Not many
people use it and it may introduce problems. I'm also
not sure, if all function prototypes are C declared.

Harald

At 16:18 14.06.2005 +0200, you wrote:
>Hi Harald,
>
>I still get the multiple definition error. I've started adding the
>object-files one by one to the link command and found out that this
>error occurs when I'm linking a object file that uses realloc.
>
>Mustn't I use realloc?
>
>
>Btw, I need -lnutcpp because I'm using C++.
>
>stephan
>
>On Tue, 2005-06-14 at 10:34, Harald Kipp wrote:
> > Hello Stephan,
> >
> > All Nut/OS libs must come first. I do not think you'd need to
> > specify -lc -lgcc. But if, put it at the end only. And do you
> > really need -lnutcpp? I don't think so.
> >
> > How about
> > ~/nut/lib/nutinit.o  -lnutnet -lnutpro -lnutfs -lnutos -lnutdev \
> > -lnutnet -lnutcrt -o obj/myprog.o
> >
> > Any reason why you don't use the same Makefiles as the sample
> > applications?
> >
> > Harald




More information about the En-Nut-Discussion mailing list