|
From: | Giuseppe Modugno |
Subject: | Re: [lwip-users] Errors during build of lwip in Windows |
Date: | Mon, 17 Apr 2023 08:38:56 +0200 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 |
Il 15/04/2023 01:58, Giuseppe Modugno ha scritto: [...]
Now I enabled LWIP_MQTT_APP and I receive the following errors during build:[ 99%] Linking C executable example_app.exeliblwipcontribexamples.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 statusmingw32-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 2mingw32-make.exe: *** [Makefile:135: all] Error 2I couldn't understand why, because mqtt.c is really compiled and linked in liblwipallapps.a.
I think I understood. In CMakeLists.txt there's the following line:target_link_libraries(example_app ${LWIP_SANITIZER_LIBS} lwipallapps lwipcontribexamples lwipcontribapps lwipcontribaddons lwipcontribportwindows lwipcore lwipmbedtls)
I don't know exactly why, but the problem disappeared in my build system after postponing lwipallapps, such as:
target_link_libraries(example_app ${LWIP_SANITIZER_LIBS} lwipcontribexamples lwipallapps lwipcontribapps lwipcontribaddons lwipcontribportwindows lwipcore lwipmbedtls)
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.
[...]I suspect there's a problem with WinPcap libraries. If I try to connect to the http server from another machine, it works. Even ping to lwip doesn't work from the Windows host machine.
Do you know how this can be solved?
[Prev in Thread] | Current Thread | [Next in Thread] |