CMake building problems adding the cpp_utils component by N.Kolban

GabriSer87
Posts: 1
Joined: Sat Apr 11, 2020 2:09 pm

CMake building problems adding the cpp_utils component by N.Kolban

Postby GabriSer87 » Sat Apr 11, 2020 4:57 pm

Hello everyone,
I'm trying to include the great (IMO) cpp_utils component by Neil Kolban into an ESP-IDF project. Initially I made a simple program using the GPIO.h interface provided by the Kolban's library in order to blink an LED. The program build and run without any sort of problems.

Then I moved forward activating the Bluetooth functionalities using the idf.py menuconfig tool and adding some src files (IndioClient.cpp and IndioClient.h) as an additional component, called indiotech.
The IndioClient.cpp file include the BLEDevice.h interface provided by the Kolban's library.
The structure of the program is the following:

Code: Select all

- hello_world_ble/
             		- CMakeLists.txt
             		- sdkconfig
             		- components/ 
                        		   - cpp_utils/ 
                                        		 - CMakeLists.txt
                                        		 - many src files
                                         		 - many header files
                           		  - indiotech/ 
                                         		- CMakeLists.txt
                                        		 - IndioClient.cpp
                                         		 - IndioClient.h
                                         		 - IndioSensor.cpp
                                         		 - IndioSensor.h
             - main/       
                           - main.cpp
                           - CMakeLists.txt
This is what I get running idf.py reconfigure:

Code: Select all

C:\Users\gabri\Documents\esp_workspace\hello_world_ble>idf.py reconfigure
Checking Python dependencies...
Python requirements from C:\Users\gabri\esp-idf\requirements.txt are satisfied.
Executing action: reconfigure
Running cmake in directory c:\users\gabri\documents\esp_workspace\hello_world_ble\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 --warn-uninitialized -DCCACHE_ENABLE=0 c:\users\gabri\documents\esp_workspace\hello_world_ble"...
Warn about uninitialized values.
-- mconf-idf version mconf-v4.6.0.0-idf-20190628-win32
-- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.
-- Project version: 1
-- Building ESP-IDF components for target esp32
-- Could NOT find Perl (missing: PERL_EXECUTABLE)
-- Adding linker script C:/Users/gabri/Documents/esp_workspace/hello_world_ble/build/esp-idf/esp32/esp32_out.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/esp32/ld/esp32.project.ld.in
-- Adding linker script C:/Users/gabri/esp-idf/components/esp32/ld/esp32.peripherals.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Components: app_trace app_update asio bootloader bootloader_support bt coap console cpp_utils cxx driver efuse esp-tls esp32 esp_adc_cal esp_common esp_eth esp_event esp_gdbstub esp_http_client esp_http_server esp_https_ota esp_https_server esp_local_ctrl esp_ringbuf esp_rom esp_websocket_client esp_wifi espcoredump esptool_py expat fatfs freemodbus freertos heap idf_test indiotech jsmn json libsodium log lwip main mbedtls mdns mqtt newlib nghttp nvs_flash openssl partition_table protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport tcpip_adapter ulp unity vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: C:/Users/gabri/esp-idf/components/app_trace C:/Users/gabri/esp-idf/components/app_update C:/Users/gabri/esp-idf/components/asio C:/Users/gabri/esp-idf/components/bootloader C:/Users/gabri/esp-idf/components/bootloader_support C:/Users/gabri/esp-idf/components/bt C:/Users/gabri/esp-idf/components/coap C:/Users/gabri/esp-idf/components/console C:/Users/gabri/Documents/esp_workspace/hello_world_ble/components/cpp_utils C:/Users/gabri/esp-idf/components/cxx C:/Users/gabri/esp-idf/components/driver C:/Users/gabri/esp-idf/components/efuse C:/Users/gabri/esp-idf/components/esp-tls C:/Users/gabri/esp-idf/components/esp32 C:/Users/gabri/esp-idf/components/esp_adc_cal C:/Users/gabri/esp-idf/components/esp_common C:/Users/gabri/esp-idf/components/esp_eth C:/Users/gabri/esp-idf/components/esp_event C:/Users/gabri/esp-idf/components/esp_gdbstub C:/Users/gabri/esp-idf/components/esp_http_client C:/Users/gabri/esp-idf/components/esp_http_server C:/Users/gabri/esp-idf/components/esp_https_ota C:/Users/gabri/esp-idf/components/esp_https_server C:/Users/gabri/esp-idf/components/esp_local_ctrl C:/Users/gabri/esp-idf/components/esp_ringbuf C:/Users/gabri/esp-idf/components/esp_rom C:/Users/gabri/esp-idf/components/esp_websocket_client C:/Users/gabri/esp-idf/components/esp_wifi C:/Users/gabri/esp-idf/components/espcoredump C:/Users/gabri/esp-idf/components/esptool_py C:/Users/gabri/esp-idf/components/expat C:/Users/gabri/esp-idf/components/fatfs C:/Users/gabri/esp-idf/components/freemodbus C:/Users/gabri/esp-idf/components/freertos C:/Users/gabri/esp-idf/components/heap C:/Users/gabri/esp-idf/components/idf_test C:/Users/gabri/Documents/esp_workspace/hello_world_ble/components/indiotech C:/Users/gabri/esp-idf/components/jsmn C:/Users/gabri/esp-idf/components/json C:/Users/gabri/esp-idf/components/libsodium C:/Users/gabri/esp-idf/components/log C:/Users/gabri/esp-idf/components/lwip C:/Users/gabri/Documents/esp_workspace/hello_world_ble/main C:/Users/gabri/esp-idf/components/mbedtls C:/Users/gabri/esp-idf/components/mdns C:/Users/gabri/esp-idf/components/mqtt C:/Users/gabri/esp-idf/components/newlib C:/Users/gabri/esp-idf/components/nghttp C:/Users/gabri/esp-idf/components/nvs_flash C:/Users/gabri/esp-idf/components/openssl C:/Users/gabri/esp-idf/components/partition_table C:/Users/gabri/esp-idf/components/protobuf-c C:/Users/gabri/esp-idf/components/protocomm C:/Users/gabri/esp-idf/components/pthread C:/Users/gabri/esp-idf/components/sdmmc C:/Users/gabri/esp-idf/components/soc C:/Users/gabri/esp-idf/components/spi_flash C:/Users/gabri/esp-idf/components/spiffs C:/Users/gabri/esp-idf/components/tcp_transport C:/Users/gabri/esp-idf/components/tcpip_adapter C:/Users/gabri/esp-idf/components/ulp C:/Users/gabri/esp-idf/components/unity C:/Users/gabri/esp-idf/components/vfs C:/Users/gabri/esp-idf/components/wear_levelling C:/Users/gabri/esp-idf/components/wifi_provisioning C:/Users/gabri/esp-idf/components/wpa_supplicant C:/Users/gabri/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/gabri/Documents/esp_workspace/hello_world_ble/build

Both cpp_utils and indiotech components are included and also the bt component from ESP-IDF is correctly included.
But when I try to build this project the compilation process fail with the following output:

Code: Select all

C:\Users\gabri\Documents\esp_workspace\hello_world_ble>idf.py build
Checking Python dependencies...
Python requirements from C:\Users\gabri\esp-idf\requirements.txt are satisfied.
Executing action: all (aliases: build)
Running cmake in directory c:\users\gabri\documents\esp_workspace\hello_world_ble\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 --warn-uninitialized -DCCACHE_ENABLE=0 c:\users\gabri\documents\esp_workspace\hello_world_ble"...
Warn about uninitialized values.
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.21.0.windows.1")
-- mconf-idf version mconf-v4.6.0.0-idf-20190628-win32
-- IDF_TARGET not set, using default target: esp32
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/gabri/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/Users/gabri/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/Users/gabri/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Users/gabri/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe
-- Check for working CXX compiler: C:/Users/gabri/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.
-- Project version: 1
-- Building ESP-IDF components for target esp32
-- Found PythonInterp: C:/Users/gabri/.espressif/python_env/idf4.0_py3.7_env/Scripts/python.exe (found version "3.7")
-- Could NOT find Perl (missing: PERL_EXECUTABLE)
-- Adding linker script C:/Users/gabri/Documents/esp_workspace/hello_world_ble/build/esp-idf/esp32/esp32_out.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/esp32/ld/esp32.project.ld.in
-- Adding linker script C:/Users/gabri/esp-idf/components/esp32/ld/esp32.peripherals.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Components: app_trace app_update asio bootloader bootloader_support bt coap console cpp_utils cxx driver efuse esp-tls esp32 esp_adc_cal esp_common esp_eth esp_event esp_gdbstub esp_http_client esp_http_server esp_https_ota esp_https_server esp_local_ctrl esp_ringbuf esp_rom esp_websocket_client esp_wifi espcoredump esptool_py expat fatfs freemodbus freertos heap idf_test indiotech jsmn json libsodium log lwip main mbedtls mdns mqtt newlib nghttp nvs_flash openssl partition_table protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport tcpip_adapter ulp unity vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: C:/Users/gabri/esp-idf/components/app_trace C:/Users/gabri/esp-idf/components/app_update C:/Users/gabri/esp-idf/components/asio C:/Users/gabri/esp-idf/components/bootloader C:/Users/gabri/esp-idf/components/bootloader_support C:/Users/gabri/esp-idf/components/bt C:/Users/gabri/esp-idf/components/coap C:/Users/gabri/esp-idf/components/console C:/Users/gabri/Documents/esp_workspace/hello_world_ble/components/cpp_utils C:/Users/gabri/esp-idf/components/cxx C:/Users/gabri/esp-idf/components/driver C:/Users/gabri/esp-idf/components/efuse C:/Users/gabri/esp-idf/components/esp-tls C:/Users/gabri/esp-idf/components/esp32 C:/Users/gabri/esp-idf/components/esp_adc_cal C:/Users/gabri/esp-idf/components/esp_common C:/Users/gabri/esp-idf/components/esp_eth C:/Users/gabri/esp-idf/components/esp_event C:/Users/gabri/esp-idf/components/esp_gdbstub C:/Users/gabri/esp-idf/components/esp_http_client C:/Users/gabri/esp-idf/components/esp_http_server C:/Users/gabri/esp-idf/components/esp_https_ota C:/Users/gabri/esp-idf/components/esp_https_server C:/Users/gabri/esp-idf/components/esp_local_ctrl C:/Users/gabri/esp-idf/components/esp_ringbuf C:/Users/gabri/esp-idf/components/esp_rom C:/Users/gabri/esp-idf/components/esp_websocket_client C:/Users/gabri/esp-idf/components/esp_wifi C:/Users/gabri/esp-idf/components/espcoredump C:/Users/gabri/esp-idf/components/esptool_py C:/Users/gabri/esp-idf/components/expat C:/Users/gabri/esp-idf/components/fatfs C:/Users/gabri/esp-idf/components/freemodbus C:/Users/gabri/esp-idf/components/freertos C:/Users/gabri/esp-idf/components/heap C:/Users/gabri/esp-idf/components/idf_test C:/Users/gabri/Documents/esp_workspace/hello_world_ble/components/indiotech C:/Users/gabri/esp-idf/components/jsmn C:/Users/gabri/esp-idf/components/json C:/Users/gabri/esp-idf/components/libsodium C:/Users/gabri/esp-idf/components/log C:/Users/gabri/esp-idf/components/lwip C:/Users/gabri/Documents/esp_workspace/hello_world_ble/main C:/Users/gabri/esp-idf/components/mbedtls C:/Users/gabri/esp-idf/components/mdns C:/Users/gabri/esp-idf/components/mqtt C:/Users/gabri/esp-idf/components/newlib C:/Users/gabri/esp-idf/components/nghttp C:/Users/gabri/esp-idf/components/nvs_flash C:/Users/gabri/esp-idf/components/openssl C:/Users/gabri/esp-idf/components/partition_table C:/Users/gabri/esp-idf/components/protobuf-c C:/Users/gabri/esp-idf/components/protocomm C:/Users/gabri/esp-idf/components/pthread C:/Users/gabri/esp-idf/components/sdmmc C:/Users/gabri/esp-idf/components/soc C:/Users/gabri/esp-idf/components/spi_flash C:/Users/gabri/esp-idf/components/spiffs C:/Users/gabri/esp-idf/components/tcp_transport C:/Users/gabri/esp-idf/components/tcpip_adapter C:/Users/gabri/esp-idf/components/ulp C:/Users/gabri/esp-idf/components/unity C:/Users/gabri/esp-idf/components/vfs C:/Users/gabri/esp-idf/components/wear_levelling C:/Users/gabri/esp-idf/components/wifi_provisioning C:/Users/gabri/esp-idf/components/wpa_supplicant C:/Users/gabri/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/gabri/Documents/esp_workspace/hello_world_ble/build
Running ninja in directory c:\users\gabri\documents\esp_workspace\hello_world_ble\build
Executing "ninja all"...
[500/1149] Performing configure step for 'bootloader'
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.21.0.windows.1")
-- mconf-idf version mconf-v4.6.0.0-idf-20190628-win32
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/gabri/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/Users/gabri/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/Users/gabri/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Users/gabri/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe
-- Check for working CXX compiler: C:/Users/gabri/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Project version: v4.0-dirty
-- Building ESP-IDF components for target esp32
-- Adding linker script C:/Users/gabri/esp-idf/components/esp32/ld/esp32.peripherals.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/bootloader/subproject/main/esp32.bootloader.ld
-- Adding linker script C:/Users/gabri/esp-idf/components/bootloader/subproject/main/esp32.bootloader.rom.ld
-- Components: bootloader bootloader_support efuse esp32 esp_common esp_rom esptool_py log main micro-ecc partition_table soc spi_flash xtensa
-- Component paths: C:/Users/gabri/esp-idf/components/bootloader C:/Users/gabri/esp-idf/components/bootloader_support C:/Users/gabri/esp-idf/components/efuse C:/Users/gabri/esp-idf/components/esp32 C:/Users/gabri/esp-idf/components/esp_common C:/Users/gabri/esp-idf/components/esp_rom C:/Users/gabri/esp-idf/components/esptool_py C:/Users/gabri/esp-idf/components/log C:/Users/gabri/esp-idf/components/bootloader/subproject/main C:/Users/gabri/esp-idf/components/bootloader/subproject/components/micro-ecc C:/Users/gabri/esp-idf/components/partition_table C:/Users/gabri/esp-idf/components/soc C:/Users/gabri/esp-idf/components/spi_flash C:/Users/gabri/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/gabri/Documents/esp_workspace/hello_world_ble/build/bootloader
[539/1149] Performing build step for 'bootloader'
[1/62] Generating project_elf_src.c
[2/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/gpio_periph.c.obj
[3/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/cpu_util.c.obj
[4/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_init.c.obj
[5/62] Building C object CMakeFiles/bootloader.elf.dir/project_elf_src.c.obj
[6/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_clk_init.c.obj
[7/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_clk.c.obj
[8/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_periph.c.obj
[9/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_pm.c.obj
[10/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/sdio_slave_periph.c.obj
[11/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_time.c.obj
[12/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_sleep.c.obj
[13/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_wdt.c.obj
[14/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/memory_layout_utils.c.obj
[15/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/spi_periph.c.obj
[16/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_hal_iram.c.obj
[17/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/soc_memory_layout.c.obj
[18/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/lldesc.c.obj
[19/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/sdmmc_periph.c.obj
[20/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_hal.c.obj
[21/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/soc_include_legacy_warn.c.obj
[22/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_flash_hal.c.obj
[23/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_slave_hal_iram.c.obj
[24/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_flash_hal_iram.c.obj
[25/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_slave_hal.c.obj
[26/62] Building C object esp-idf/xtensa/CMakeFiles/__idf_xtensa.dir/trax.c.obj
[27/62] Building C object esp-idf/xtensa/CMakeFiles/__idf_xtensa.dir/eri.c.obj
[28/62] Building ASM object esp-idf/xtensa/CMakeFiles/__idf_xtensa.dir/debug_helpers_asm.S.obj
[29/62] Building C object esp-idf/xtensa/CMakeFiles/__idf_xtensa.dir/debug_helpers.c.obj
[30/62] Building C object esp-idf/log/CMakeFiles/__idf_log.dir/log.c.obj
[31/62] Building C object esp-idf/spi_flash/CMakeFiles/__idf_spi_flash.dir/spi_flash_rom_patch.c.obj
[32/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_random.c.obj
[33/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_flash.c.obj
[34/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_flash_config.c.obj
[35/62] Linking C static library esp-idf\log\liblog.a
[36/62] Building C object esp-idf/micro-ecc/CMakeFiles/__idf_micro-ecc.dir/micro-ecc/uECC.c.obj
[37/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_clock.c.obj
[38/62] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/esp32/esp_efuse_table.c.obj
[39/62] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/src/esp_efuse_fields.c.obj
[40/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_common.c.obj
[41/62] Linking C static library esp-idf\xtensa\libxtensa.a
[42/62] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/src/esp_efuse_api.c.obj
[43/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/flash_encrypt.c.obj
[44/62] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/src/esp_efuse_utility.c.obj
[45/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_utility.c.obj
[46/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp_image_format.c.obj
[47/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/flash_partitions.c.obj
[48/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32/bootloader_sha.c.obj
[49/62] Linking C static library esp-idf\soc\libsoc.a
[50/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_init.c.obj
[51/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32/flash_encrypt.c.obj
[52/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/flash_qio_mode.c.obj
[53/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32/secure_boot_signatures.c.obj
[54/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32/secure_boot.c.obj
[55/62] Linking C static library esp-idf\micro-ecc\libmicro-ecc.a
[56/62] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/bootloader_start.c.obj
[57/62] Linking C static library esp-idf\bootloader_support\libbootloader_support.a
[58/62] Linking C static library esp-idf\efuse\libefuse.a
[59/62] Linking C static library esp-idf\spi_flash\libspi_flash.a
[60/62] Linking C static library esp-idf\main\libmain.a
[61/62] Linking C executable bootloader.elf
[62/62] Generating binary image from built executable
esptool.py v2.8
Generated C:/Users/gabri/Documents/esp_workspace/hello_world_ble/build/bootloader/bootloader.bin
[1059/1149] Building CXX object esp-idf/cpp_utils/CMakeFiles/__idf_cpp_utils.dir/BLEAddress.cpp.obj
FAILED: esp-idf/cpp_utils/CMakeFiles/__idf_cpp_utils.dir/BLEAddress.cpp.obj
C:\Users\gabri\.espressif\tools\xtensa-esp32-elf\esp-2019r2-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe  -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -Iconfig -I../components/cpp_utils -IC:/Users/gabri/esp-idf/components/newlib/platform_include -IC:/Users/gabri/esp-idf/components/freertos/include -IC:/Users/gabri/esp-idf/components/heap/include -IC:/Users/gabri/esp-idf/components/log/include -IC:/Users/gabri/esp-idf/components/soc/esp32/include -IC:/Users/gabri/esp-idf/components/soc/include -IC:/Users/gabri/esp-idf/components/esp_rom/include -IC:/Users/gabri/esp-idf/components/esp_common/include -IC:/Users/gabri/esp-idf/components/xtensa/include -IC:/Users/gabri/esp-idf/components/xtensa/esp32/include -IC:/Users/gabri/esp-idf/components/esp32/include -IC:/Users/gabri/esp-idf/components/driver/include -IC:/Users/gabri/esp-idf/components/esp_ringbuf/include -IC:/Users/gabri/esp-idf/components/esp_event/include -IC:/Users/gabri/esp-idf/components/tcpip_adapter/include -IC:/Users/gabri/esp-idf/components/lwip/include/apps -IC:/Users/gabri/esp-idf/components/lwip/include/apps/sntp -IC:/Users/gabri/esp-idf/components/lwip/lwip/src/include -IC:/Users/gabri/esp-idf/components/lwip/port/esp32/include -IC:/Users/gabri/esp-idf/components/lwip/port/esp32/include/arch -IC:/Users/gabri/esp-idf/components/vfs/include -IC:/Users/gabri/esp-idf/components/esp_wifi/include -IC:/Users/gabri/esp-idf/components/esp_wifi/esp32/include -IC:/Users/gabri/esp-idf/components/esp_eth/include -IC:/Users/gabri/esp-idf/components/efuse/include -IC:/Users/gabri/esp-idf/components/efuse/esp32/include -IC:/Users/gabri/esp-idf/components/app_trace/include -IC:/Users/gabri/esp-idf/components/console -IC:/Users/gabri/esp-idf/components/fatfs/diskio -IC:/Users/gabri/esp-idf/components/fatfs/vfs -IC:/Users/gabri/esp-idf/components/fatfs/src -IC:/Users/gabri/esp-idf/components/wear_levelling/include -IC:/Users/gabri/esp-idf/components/spi_flash/include -IC:/Users/gabri/esp-idf/components/sdmmc/include -IC:/Users/gabri/esp-idf/components/json/cJSON -IC:/Users/gabri/esp-idf/components/mdns/include -IC:/Users/gabri/esp-idf/components/mbedtls/port/include -IC:/Users/gabri/esp-idf/components/mbedtls/mbedtls/include -IC:/Users/gabri/esp-idf/components/nvs_flash/include -mlongcalls -Wno-frame-address   -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -nostdlib -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -std=gnu++11 -fexceptions -fno-rtti -D_GNU_SOURCE -DIDF_VER=\"v4.0-dirty\" -DGCC_NOT_5_2_0 -DESP_PLATFORM -MD -MT esp-idf/cpp_utils/CMakeFiles/__idf_cpp_utils.dir/BLEAddress.cpp.obj -MF esp-idf\cpp_utils\CMakeFiles\__idf_cpp_utils.dir\BLEAddress.cpp.obj.d -o esp-idf/cpp_utils/CMakeFiles/__idf_cpp_utils.dir/BLEAddress.cpp.obj -c ../components/cpp_utils/BLEAddress.cpp
In file included from ../components/cpp_utils/BLEAddress.cpp:10:
../components/cpp_utils/BLEAddress.h:12:10: fatal error: esp_gap_ble_api.h: No such file or directory
 #include <esp_gap_ble_api.h> // ESP32 BLE
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
[1062/1149] Building CXX object esp-idf/cpp_utils/CMakeFiles/__idf_cpp_utils.dir/BLE2904.cpp.obj
FAILED: esp-idf/cpp_utils/CMakeFiles/__idf_cpp_utils.dir/BLE2904.cpp.obj
C:\Users\gabri\.espressif\tools\xtensa-esp32-elf\esp-2019r2-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe  -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -Iconfig -I../components/cpp_utils -IC:/Users/gabri/esp-idf/components/newlib/platform_include -IC:/Users/gabri/esp-idf/components/freertos/include -IC:/Users/gabri/esp-idf/components/heap/include -IC:/Users/gabri/esp-idf/components/log/include -IC:/Users/gabri/esp-idf/components/soc/esp32/include -IC:/Users/gabri/esp-idf/components/soc/include -IC:/Users/gabri/esp-idf/components/esp_rom/include -IC:/Users/gabri/esp-idf/components/esp_common/include -IC:/Users/gabri/esp-idf/components/xtensa/include -IC:/Users/gabri/esp-idf/components/xtensa/esp32/include -IC:/Users/gabri/esp-idf/components/esp32/include -IC:/Users/gabri/esp-idf/components/driver/include -IC:/Users/gabri/esp-idf/components/esp_ringbuf/include -IC:/Users/gabri/esp-idf/components/esp_event/include -IC:/Users/gabri/esp-idf/components/tcpip_adapter/include -IC:/Users/gabri/esp-idf/components/lwip/include/apps -IC:/Users/gabri/esp-idf/components/lwip/include/apps/sntp -IC:/Users/gabri/esp-idf/components/lwip/lwip/src/include -IC:/Users/gabri/esp-idf/components/lwip/port/esp32/include -IC:/Users/gabri/esp-idf/components/lwip/port/esp32/include/arch -IC:/Users/gabri/esp-idf/components/vfs/include -IC:/Users/gabri/esp-idf/components/esp_wifi/include -IC:/Users/gabri/esp-idf/components/esp_wifi/esp32/include -IC:/Users/gabri/esp-idf/components/esp_eth/include -IC:/Users/gabri/esp-idf/components/efuse/include -IC:/Users/gabri/esp-idf/components/efuse/esp32/include -IC:/Users/gabri/esp-idf/components/app_trace/include -IC:/Users/gabri/esp-idf/components/console -IC:/Users/gabri/esp-idf/components/fatfs/diskio -IC:/Users/gabri/esp-idf/components/fatfs/vfs -IC:/Users/gabri/esp-idf/components/fatfs/src -IC:/Users/gabri/esp-idf/components/wear_levelling/include -IC:/Users/gabri/esp-idf/components/spi_flash/include -IC:/Users/gabri/esp-idf/components/sdmmc/include -IC:/Users/gabri/esp-idf/components/json/cJSON -IC:/Users/gabri/esp-idf/components/mdns/include -IC:/Users/gabri/esp-idf/components/mbedtls/port/include -IC:/Users/gabri/esp-idf/components/mbedtls/mbedtls/include -IC:/Users/gabri/esp-idf/components/nvs_flash/include -mlongcalls -Wno-frame-address   -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -nostdlib -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -std=gnu++11 -fexceptions -fno-rtti -D_GNU_SOURCE -DIDF_VER=\"v4.0-dirty\" -DGCC_NOT_5_2_0 -DESP_PLATFORM -MD -MT esp-idf/cpp_utils/CMakeFiles/__idf_cpp_utils.dir/BLE2904.cpp.obj -MF esp-idf\cpp_utils\CMakeFiles\__idf_cpp_utils.dir\BLE2904.cpp.obj.d -o esp-idf/cpp_utils/CMakeFiles/__idf_cpp_utils.dir/BLE2904.cpp.obj -c ../components/cpp_utils/BLE2904.cpp
In file included from ../components/cpp_utils/BLEDescriptor.h:13,
                 from ../components/cpp_utils/BLE2904.h:13,
                 from ../components/cpp_utils/BLE2904.cpp:15:
../components/cpp_utils/BLEUUID.h:12:10: fatal error: esp_gatt_defs.h: No such file or directory
 #include <esp_gatt_defs.h>
          ^~~~~~~~~~~~~~~~~
compilation terminated.
[1063/1149] Building CXX object esp-idf/cpp_utils/CMakeFiles/__idf_cpp_utils.dir/BLE2902.cpp.obj
FAILED: esp-idf/cpp_utils/CMakeFiles/__idf_cpp_utils.dir/BLE2902.cpp.obj
C:\Users\gabri\.espressif\tools\xtensa-esp32-elf\esp-2019r2-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe  -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -Iconfig -I../components/cpp_utils -IC:/Users/gabri/esp-idf/components/newlib/platform_include -IC:/Users/gabri/esp-idf/components/freertos/include -IC:/Users/gabri/esp-idf/components/heap/include -IC:/Users/gabri/esp-idf/components/log/include -IC:/Users/gabri/esp-idf/components/soc/esp32/include -IC:/Users/gabri/esp-idf/components/soc/include -IC:/Users/gabri/esp-idf/components/esp_rom/include -IC:/Users/gabri/esp-idf/components/esp_common/include -IC:/Users/gabri/esp-idf/components/xtensa/include -IC:/Users/gabri/esp-idf/components/xtensa/esp32/include -IC:/Users/gabri/esp-idf/components/esp32/include -IC:/Users/gabri/esp-idf/components/driver/include -IC:/Users/gabri/esp-idf/components/esp_ringbuf/include -IC:/Users/gabri/esp-idf/components/esp_event/include -IC:/Users/gabri/esp-idf/components/tcpip_adapter/include -IC:/Users/gabri/esp-idf/components/lwip/include/apps -IC:/Users/gabri/esp-idf/components/lwip/include/apps/sntp -IC:/Users/gabri/esp-idf/components/lwip/lwip/src/include -IC:/Users/gabri/esp-idf/components/lwip/port/esp32/include -IC:/Users/gabri/esp-idf/components/lwip/port/esp32/include/arch -IC:/Users/gabri/esp-idf/components/vfs/include -IC:/Users/gabri/esp-idf/components/esp_wifi/include -IC:/Users/gabri/esp-idf/components/esp_wifi/esp32/include -IC:/Users/gabri/esp-idf/components/esp_eth/include -IC:/Users/gabri/esp-idf/components/efuse/include -IC:/Users/gabri/esp-idf/components/efuse/esp32/include -IC:/Users/gabri/esp-idf/components/app_trace/include -IC:/Users/gabri/esp-idf/components/console -IC:/Users/gabri/esp-idf/components/fatfs/diskio -IC:/Users/gabri/esp-idf/components/fatfs/vfs -IC:/Users/gabri/esp-idf/components/fatfs/src -IC:/Users/gabri/esp-idf/components/wear_levelling/include -IC:/Users/gabri/esp-idf/components/spi_flash/include -IC:/Users/gabri/esp-idf/components/sdmmc/include -IC:/Users/gabri/esp-idf/components/json/cJSON -IC:/Users/gabri/esp-idf/components/mdns/include -IC:/Users/gabri/esp-idf/components/mbedtls/port/include -IC:/Users/gabri/esp-idf/components/mbedtls/mbedtls/include -IC:/Users/gabri/esp-idf/components/nvs_flash/include -mlongcalls -Wno-frame-address   -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -nostdlib -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -std=gnu++11 -fexceptions -fno-rtti -D_GNU_SOURCE -DIDF_VER=\"v4.0-dirty\" -DGCC_NOT_5_2_0 -DESP_PLATFORM -MD -MT esp-idf/cpp_utils/CMakeFiles/__idf_cpp_utils.dir/BLE2902.cpp.obj -MF esp-idf\cpp_utils\CMakeFiles\__idf_cpp_utils.dir\BLE2902.cpp.obj.d -o esp-idf/cpp_utils/CMakeFiles/__idf_cpp_utils.dir/BLE2902.cpp.obj -c ../components/cpp_utils/BLE2902.cpp
In file included from ../components/cpp_utils/BLEDescriptor.h:13,
                 from ../components/cpp_utils/BLE2902.h:13,
                 from ../components/cpp_utils/BLE2902.cpp:15:
../components/cpp_utils/BLEUUID.h:12:10: fatal error: esp_gatt_defs.h: No such file or directory
 #include <esp_gatt_defs.h>
          ^~~~~~~~~~~~~~~~~
compilation terminated.
[1064/1149] Building CXX object esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
The problem seems related to the missing reference to the esp_gatt_defs.h file provided by the ESP-IDF.
Can you help me in interpreting the output of the compiler and fixing the broken dependencies?
Any help will be appreciated.
Thanks,
Gabriele (Italy)

wegunterjr
Posts: 37
Joined: Thu Jun 07, 2018 3:05 am

Re: CMake building problems adding the cpp_utils component by N.Kolban

Postby wegunterjr » Tue May 05, 2020 11:41 pm

did you ever get a response? I am having a similar problem...

wirvine90
Posts: 7
Joined: Wed May 06, 2020 5:24 pm

Re: CMake building problems adding the cpp_utils component by N.Kolban

Postby wirvine90 » Wed May 06, 2020 5:27 pm

I had this same issue in the past. This was about 6 months ago but I believe I needed to activate the BT Configuration in MenuConfig.

Component Config -> Bluetooth.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: CMake building problems adding the cpp_utils component by N.Kolban

Postby ESP_Angus » Thu May 07, 2020 4:02 am

As well as BT configuration setting, in the CMake build system, components need to declare which other components they require.

For source files in the cpp_utils component to be able to include headers from "bt" component, they will need to declare this requirement in the cpp_utils/CMakeLists.txt file.

For a full explanation, see the IDF docs here:
https://docs.espressif.com/projects/esp ... quirements

wegunterjr
Posts: 37
Joined: Thu Jun 07, 2018 3:05 am

Re: CMake building problems adding the cpp_utils component by N.Kolban

Postby wegunterjr » Tue Jun 23, 2020 3:53 am

so I added "bt" to the default CMakeLists.txt that was in the NKolban Repo....
Is this the only place that it is needed, or are you suggesting I need to add a requirement for including headers?

Code: Select all

# Edit following two lines to set component requirements (see docs)
set(COMPONENT_REQUIRES
  "console"
  "fatfs"
  "json"
  "mdns"
  "nvs_flash"
  "bt"
)
set(COMPONENT_PRIV_REQUIRES bt )

file(GLOB COMPONENT_SRCS
  LIST_DIRECTORIES false
  "*.h"
  "*.cpp"
  "*.c"
  "*.S"
)
set(COMPONENT_ADD_INCLUDEDIRS ".")

register_component()

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: CMake building problems adding the cpp_utils component by N.Kolban

Postby ESP_Angus » Wed Jun 24, 2020 4:22 am

wegunterjr wrote:
Tue Jun 23, 2020 3:53 am
so I added "bt" to the default CMakeLists.txt that was in the NKolban Repo....
Is this the only place that it is needed, or are you suggesting I need to add a requirement for including headers?
Doing this will allow this component's source files and headers to include headers defined in the "bt" component. You don't have to add anything else in order to use headers in "bt" (note that Bluetooth also needs to be enabled in the project configuration.)

Does the component build now? If yes, this is all you need to do. If no, might be that some other component requirement needs to be added as well.

AlexL2
Posts: 1
Joined: Tue Feb 21, 2023 6:05 am

Re: CMake building problems adding the cpp_utils component by N.Kolban

Postby AlexL2 » Tue Feb 21, 2023 6:11 am

Finally! I found how to solve this build issue with "missing" Bluetooth headers.
Thanks a lot!

Who is online

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