Using esp-azure in a component
Posted: Fri Jul 09, 2021 9:16 am
Hello,
we want to use the esp-azure library in a esp-idf-component, but we are getting errors during the linker-process.
The code below shows a section of the error messages.
We are using the esp-idf v4.3 with the actual version from the esp-azure library with an ESP32S2.
In our CMakeList.txt of the cloud component we have already specified the "port" component as required.
In our top-level-CMakeList we have already set the extra component directory:
Can anybody post an example, with the esp-azure library used in a component?
Thank you!
we want to use the esp-azure library in a esp-idf-component, but we are getting errors during the linker-process.
The code below shows a section of the error messages.
We are using the esp-idf v4.3 with the actual version from the esp-azure library with an ESP32S2.
- [986/987] Linking CXX executable app.elf
- FAILED: *******.elf
- cmd.exe /C "cd . && ~\.espressif\tools\xtensa-esp32s2-elf\esp-2020r3-8.4.0\xtensa-esp32s2-elf\bin\xtensa-esp32s2-elf-g++.exe -mlongcalls @CMakeFiles\esign.elf.rsp -o esign.elf && cd ."
- ~/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: esp-idf/cloud/libcloud.a(cloud.c.obj):(.literal.register_device_callback+0xc): undefined reference to `mallocAndStrcpy_s'
- ~/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: esp-idf/cloud/cloud.a(cloud.c.obj):(.literal.cloud_init+0x10): undefined reference to `Prov_Device_MQTT_Protocol'
- [...]
- set(component_srcs "src/cloud.c")
- idf_component_register(SRCS "${component_srcs}"
- INCLUDE_DIRS "include" "."
- PRIV_INCLUDE_DIRS ""
- PRIV_REQUIRES "driver"
- REQUIRES "port"
- EMBED_FILES "certificates/leaf_certificate.pem"
- "certificates/leaf_private_key.pem")
- component_compile_definitions(SET_TRUSTED_CERT_IN_SAMPLES)
- cmake_minimum_required(VERSION 3.5)
- include($ENV{IDF_PATH}/tools/cmake/project.cmake)
- set (EXTRA_COMPONENT_DIRS "../../esp-azure/port")
- set(COMPONENT_ADD_INCLUDEDIRS ".")
- project(......)
- idf_build_set_property(COMPILE_OPTIONS "-Werror" APPEND)
Thank you!