|
From: | address@hidden |
Subject: | Re: [lwip-devel] Can't compile due to unknown memory functions |
Date: | Tue, 28 Feb 2012 21:00:51 +0100 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 |
address@hidden wrote:
I've some troubles in compiling v1.4.0. I get several errors about unknown memory functions like lwip-1.4.0/src/core/init.c:270: undefined reference to `mem_init' lwip-1.4.0/src/core/init.c:271: undefined reference to `memp_init' lwip-1.4.0/src/core/init.c:304: undefined reference to `sys_timeouts_init'
Seems like you forgot to compile and link mem.c, memp.c and timers.c?
Now when I change my lwiopts.h and add a statement #define MEM_LIBC_MALLOC 1 there, the erros change to lwip-1.4.0/src/core/pbuf.c:286:17: error: implicit declaration of function 'malloc' lwip-1.4.0/src/core/pbuf.c:286:23: error: incompatible implicit declaration of built-in function 'malloc lwip-1.4.0/src/core/pbuf.c:654:11: error: implicit declaration of function 'free' lwip-1.4.0/src/core/pbuf.c:654:11: error: incompatible implicit declaration of built-in function 'free' What could be the reason for this? Which switches do I have to set to use malloc()/free() based memory functions?
Since not all (embedded) compilers have malloc/free defined in the same header files, we don't include them when setting MEM_LIBC_MALLOC to 1. Place an include to the correct header file somewhere (e.g. in cc.h).
Simon
[Prev in Thread] | Current Thread | [Next in Thread] |