esp_modem program build problem
Posted: Sat Dec 23, 2023 1:10 pm
Hello all.
I am using the esp_modem component in my project, and I am having problems when using the esp_modem_set_command_mode() and esp_modem_resume_data_mode() functions. I have seen that they are C functions derived from their C++ counterparts set_command_mode() and resume_data_mode().
I do not know why but the linker does not found these functions, nor search for their C++ counterparts.
Brief, the problem I am facing is that the linker does not find either of them and my project does not build.
I copy the error lines below.
Thank you for your help.
Regards,
Germán.
---
FAILED: MQTTSerie.elf
cmd.exe /C "cd . && C:\Espressif\tools\xtensa-esp32-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe -mlongcalls -Wno-frame-address @CMakeFiles\MQTTSerie.elf.rsp -o MQTTSerie.elf && cd ."
c:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/modem/libmodem.a(modem.c.obj):(.literal.modem_dataSuspend+0x4): undefined reference to `esp_modem_set_command_mode'
c:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/modem/libmodem.a(modem.c.obj):(.literal.modem_dataResume+0x4): undefined reference to `esp_modem_resume_data_mode'
c:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/modem/libmodem.a(modem.c.obj): in function `modem_dataSuspend':
C:/Users/germa/Documents/ESP44/MQTTNuevo/components/modem/modem.c:278: undefined reference to `esp_modem_set_command_mode'
c:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/modem/libmodem.a(modem.c.obj): in function `modem_dataResume':
C:/Users/germa/Documents/ESP44/MQTTNuevo/components/modem/modem.c:295: undefined reference to `esp_modem_resume_data_mode'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
I am using the esp_modem component in my project, and I am having problems when using the esp_modem_set_command_mode() and esp_modem_resume_data_mode() functions. I have seen that they are C functions derived from their C++ counterparts set_command_mode() and resume_data_mode().
I do not know why but the linker does not found these functions, nor search for their C++ counterparts.
Brief, the problem I am facing is that the linker does not find either of them and my project does not build.
I copy the error lines below.
Thank you for your help.
Regards,
Germán.
---
FAILED: MQTTSerie.elf
cmd.exe /C "cd . && C:\Espressif\tools\xtensa-esp32-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe -mlongcalls -Wno-frame-address @CMakeFiles\MQTTSerie.elf.rsp -o MQTTSerie.elf && cd ."
c:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/modem/libmodem.a(modem.c.obj):(.literal.modem_dataSuspend+0x4): undefined reference to `esp_modem_set_command_mode'
c:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/modem/libmodem.a(modem.c.obj):(.literal.modem_dataResume+0x4): undefined reference to `esp_modem_resume_data_mode'
c:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/modem/libmodem.a(modem.c.obj): in function `modem_dataSuspend':
C:/Users/germa/Documents/ESP44/MQTTNuevo/components/modem/modem.c:278: undefined reference to `esp_modem_set_command_mode'
c:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/modem/libmodem.a(modem.c.obj): in function `modem_dataResume':
C:/Users/germa/Documents/ESP44/MQTTNuevo/components/modem/modem.c:295: undefined reference to `esp_modem_resume_data_mode'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1