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.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.
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?
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users