lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Errors during build of lwip in Windows


From: Giuseppe Modugno
Subject: [lwip-users] Errors during build of lwip in Windows
Date: Sat, 15 Apr 2023 01:58:10 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0

I cloned lwip and mbedtls repositories in the same folder on a Windows system. I also put WpdPack in the same folder.

I have a mingw compiler that I'd like to use instead of Visual Studio. It works well with the following command:

  c:\tools\cmake\bin\cmake.exe -G "MinGW Makefiles" ..

entered in the folder:

  <lwip_dir>\contrib\ports\win32\example_app\build

I don't know why, but I needed to manually copy lwipcfg.h (cmake script should take care of this, but in my case it doesn't work).

I enabled LWIP_DNS_APP and LWIP_PING_APP and it apparently works well. The application is able to send PING packets and receive resonses.

Now I enabled LWIP_MQTT_APP and I receive the following errors during build:

[ 99%] Linking C executable example_app.exe
liblwipcontribexamples.a(mqtt_example.obj): In function `mqtt_connection_cb': C:/temp/lwip/contrib/examples/mqtt/mqtt_example.c:100: undefined reference to `mqtt_sub_unsub' C:/temp/lwip/contrib/examples/mqtt/mqtt_example.c:104: undefined reference to `mqtt_sub_unsub'
liblwipcontribexamples.a(mqtt_example.obj): In function `mqtt_example_init':
C:/temp/lwip/contrib/examples/mqtt/mqtt_example.c:116: undefined reference to `mqtt_client_new' C:/temp/lwip/contrib/examples/mqtt/mqtt_example.c:118: undefined reference to `mqtt_set_inpub_callback' C:/temp/lwip/contrib/examples/mqtt/mqtt_example.c:123: undefined reference to `mqtt_client_connect'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[2]: *** [CMakeFiles\example_app.dir\build.make:128: example_app.exe] Error 1 mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:358: CMakeFiles/example_app.dir/all] Error 2
mingw32-make.exe: *** [Makefile:135: all] Error 2

I couldn't understand why, because mqtt.c is really compiled and linked in liblwipallapps.a.

Similar things happen if I try to enable LWIP_TFTP_CLIENT_APP.


Lastly another strange behaviour. If I enable LWIP_HTTPD_APP, the build process is ok, but I can't see the web page on the browser when I type the URL http://192.168.1.200. This is the output from example_app.exe:

$ .\example_app.exe
Starting lwIP, local interface IP is 192.168.1.200
 0: NPF_{AC067A09-87E6-4E65-A56D-7442B541F373}
     Desc: "Oracle"
 1: NPF_{378C5F06-077E-4267-9895-80E7345D4F5F}
     Desc: "Realtek PCIe GBE Family Controller"
Using adapter_num: 1
Using adapter: "Realtek PCIe GBE Family Controller"
status_callback==UP, local interface IP is 192.168.1.200
httpd_init
tcp_bind: bind to port 80

I tried to change the server port to 55000 (HTTPD_SERVER_PORT=55000) just to avoid reserved TCP ports, but the behaviour is the same.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]