Link a library with ESP-IDF export.bat

BiHan90
Posts: 12
Joined: Thu Apr 01, 2021 9:29 am

Link a library with ESP-IDF export.bat

Postby BiHan90 » Sat Apr 24, 2021 10:02 pm

Hello Guys,

I'm trying to use ESP32 to publish topics within Mosquitto via CLion IDE (Windows 10), I'm trying to link the library (Mosquitto.lib) with ESP-IDF tools so that it helps the compiler to read it. To do that, I added this path to environment variables : C:\Program Files\mosquitto\devel

The issue is, whenever I run : export.bat, all paths get exported except the mosquitto path.. This issue leads to the disability of my compiler to detect the Mosquitto library and leads to the following errors :

c:/users/ahmed/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf\main\libmain.a(mqtt_client.c.obj):(.literal.app_main+0x18): undefined reference to `mosquitto_lib_init'

And the same error for all Mosquitto's functions : undefined reference to `mosquitto_destroy, `mosquitto_publish ...etc

Could you please help me linking Mosquitto library with ESP-IDF so that all functions get recognized ?

Thanks in advance,

Who is online

Users browsing this forum: Baidu [Spider] and 175 guests