Hi,
I’ve created an application that talks to a service via sockets.
This compiles fine, yet linking gives:
/home/folkert/.platformio/packages/toolchain-rp2040-earlephilhower/bin/../lib/gcc/arm-none-eabi/12.3.0/../../../../arm-none-eabi/bin/ld: .pio/build/BUILD_FOR_RP2040/src/server.cpp.o: in function `_ZN6serverD2Ev':
server.cpp:(.text._ZN6serverD2Ev+0xa): undefined reference to `lwip_close'
(also for lwip_accept, lwip_socket, lwip_read and so on).
I’m targetting the raspberry pi pico-w.
My platformio.ini looks like this:
[platformio]
default_envs = BUILD_FOR_RP2040
src_dir = .
[env:BUILD_FOR_RP2040]
lib_ldf_mode = deep+
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board_build.core = earlephilhower
board = rpipicow
framework = arduino
lib_deps = greiman/SdFat@^2.2.2
extra_scripts = pre:prepare.py
build_flags = -DRP2040W=1 -DARDUINO_RASPBERRY_PI_PICO_W -DPICO_STDIO_USB=1 -DDEBUG_RP2040_PORT=Serial -DDEBUG_RP2040_CORE
lwipopts.h:
#define LWIP_COMPAT_SOCKETS 1
#define LWIP_SOCKET 1
#define NO_SYS 1
#define MEM_ALIGNMENT 4
#define LWIP_RAW 1
#define LWIP_NETCONN 0
#define LWIP_DHCP 1
#define LWIP_ICMP 1
#define LWIP_UDP 0
#define LWIP_TCP 1
#define ETH_PAD_SIZE 0
#define TCP_MSS (1500 /*mtu*/ - 20 /*iphdr*/ - 20 /*tcphhr*/)
#define TCP_SND_BUF (2 * TCP_MSS)
#define LWIP_TIMEVAL_PRIVATE 0 /* Use the system-wide timeval definitions */
#define LWIP_NETIF_HOSTNAME 1
#define MEM_LIBC_MALLOC 0
#define LWIP_NETIF_STATUS_CALLBACK 1
#define LWIP_NETIF_LINK_CALLBACK 1
#define LWIP_DNS 1
Any ideas?
f.w.i.w. the complete source code is at GitHub - folkertvanheusden/iESP at RP2040W