How to create "complex" project structures ?

Baldhead
Posts: 471
Joined: Sun Mar 31, 2019 5:16 am

How to create "complex" project structures ?

Postby Baldhead » Fri Sep 06, 2019 10:05 pm

Hi,

I am practically a newbie in the esp32 world and i am starting with esp-idf.

I am trying to learn make, cmake and esp-idf projects structure at least 2 weeks and i couldn't make the "complex structure" project compile yet.

The hello_world and sdio/host example compile just fine, and i was even able to integrate esp-idf into visual studio code.
Until jtag, openocd, gdb i managed to make it work inside the visual studio code and in my hardware.
All "process" below are working fine:
"build app"
"clean app"
"flash app"
"monitor"
"menuconfig"
"openocd"

At the beginning off all these learning curve, i was mixing document version, because i download the stable version v3.2.2 and i was searching by googling, which led me to different espressif documentation pages in each new search(latest idf version for example).
So i was mixing component.mk with CMakeLists.txt.

After the penny has dropped(i understant), i uninstalled all the old files of version v3.2.2 and all other tools and started a new installation from scratch with the latest version: v4.1-dev-141-ga7e8d87d3.

I am only using now the latest documentation on espressif site link: https://docs.espressif.com/projects/esp ... ystem.html, and trying to follow the project structure, but the documentation is complicated to me, because dont have examples.
I dont know what write inside the CMakeLists.txt(beyond the minimum) or in component.mk if i need yet this file.
The link site show "commands" but dont show command sintax with examples and where applicable, etc.
The hello_world example has a CMakeLists.txt in the main directory, but in the link above don't exists this file in project structure.
I am very confused.

I download a third party component and i am trying to adapter the component inside the espressif suggested structure.
The third party component has a "little long" subdirectory structure that makes sense to me.

How to tell the compiler the path or files to add to the compiling ?
There is a simple command like: add all subdirectory from "x" path ?

I need component.mk files yet or only CMakeLists.txt or i need both files in the project(dir and/or subdir) ?
Where to put this files and what write on them ?

Attached follows my entire project without the build directory.
I hope someone gives me a light at the end of the tunnel.

PS:
Why espressif doesn't adopt any open platform like netbeans and does everything "graphical" like MPLAB from microchip for example.
When i need to add a new file, the ide does all the work of adding whatever is needed to build files like makefile,
from what i understand, without the user having to understand the whole complex compilation process.
I know that understanding compilation tools is very powerful learning but it is a pain.

It is almost getting easier to program in assembly :).


Thank's.
Attachments
esp32_ili9341-master.7z
Full Project, including ".vscode" folder.
(1.87 MiB) Downloaded 674 times

Baldhead
Posts: 471
Joined: Sun Mar 31, 2019 5:16 am

Re: How to create "complex" project structures ?

Postby Baldhead » Mon Sep 09, 2019 8:29 pm

Hi,

Now i have problems with the linkage process i think.

I would like to know how to link external libs with esp-idf, step by step if possible.


Thank's.

Baldhead
Posts: 471
Joined: Sun Mar 31, 2019 5:16 am

Re: How to create "complex" project structures ?

Postby Baldhead » Tue Sep 10, 2019 3:35 am

Hello Esp-idf team,

I need help please.
I am lost.

Give me a hand / tip.

I can update the project with the includes path corrected.

I'm pretty sure that the only problem is linking now, but i dont know how to link the external lib with the esp-idf using cmake.

Thank's.

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

Re: How to create "complex" project structures ?

Postby ESP_Angus » Tue Sep 10, 2019 4:51 am

Hi Baldhead,

Sorry to hear you've had problems making everything work. We have some improvements coming soon in the build system docs, and a major restructure is planned in the future.
Baldhead wrote:
Fri Sep 06, 2019 10:05 pm
trying to follow the project structure, but the documentation is complicated to me, because dont have examples.
You may find it helpful to look at some of the examples included with IDF, some of these have multiple components. For example, the iperf example includes "iperf" as a component:
https://github.com/espressif/esp-idf/tr ... wifi/iperf
Baldhead wrote:
Fri Sep 06, 2019 10:05 pm
I need component.mk files yet or only CMakeLists.txt or i need both files in the project(dir and/or subdir) ?
If you will build the project with "make", you need component.mk files. This is the default method in IDF v3.x and earlier, and it is supported as the "Legacy" method in v4.x.

If you build the project with "cmake" or "idf.py" then you need CMakeLists.txt files. This is the default method in IDF v4.x, ie master branch.
Baldhead wrote:
Fri Sep 06, 2019 10:05 pm
Why espressif doesn't adopt any open platform like netbeans and does everything "graphical" like MPLAB from microchip for example.
When i need to add a new file, the ide does all the work of adding whatever is needed to build files like makefile,
from what i understand, without the user having to understand the whole complex compilation process.
We have some better IDE support coming, I know it's limited compared to some other options. One of the advantages of the build systems that ESP-IDF has is that they're very flexible, once you get the hang of them then it's possible to do a lot of different things. But I agree there is a learning curve!

I took a quick look at your project and it looks like you've made a good start. The CMakeLists.txt file in components/drv/CMakeLists.txt should be something like this:

Code: Select all

idf_component_register(SRCS "disp_spi.c"
                            "ili9341.c"
                            "tp_spi.c"
                            "xpt2046.c"
                      INCLUDE_DIRS "include"
                      REQUIRES driver
                )
Very close to what you had.

You will need to add two more similar CMakeLists.txt files in the components/lv_examples directory and the components/lvgl directory if you want these files to be compiled as part of your ESP-IDF project.

If any of the components include headers from the other components (for example if "lvgl" includes headers from "drv") then you need to put something like "REQUIRES drv" in the lvgl CMakeLists.txt file.

The file main/CMakeLists.txt needs to be a "component cmakelists" file, right now it's a copy of the top-level project CMakeLists. So try something like this:

Code: Select all

idf_component_register(SRCS "main.c"
                                     )		
("main" doesn't need any REQUIRES list, it automatically includes all the other components.)

If you're still getting errors, please post the full output from the build and any other relevant details.

Baldhead
Posts: 471
Joined: Sun Mar 31, 2019 5:16 am

Re: How to create "complex" project structures ?

Postby Baldhead » Tue Sep 10, 2019 11:14 pm

Hi ESP_Angus,

I am using this version: v4.1-dev-141-ga7e8d87d3.
I think this is the latest version, because i downloaded in a few days ago.

I would like to use only CMAKE for building the project, and i hope that i can build/compile in the nexts esp-idf updates.

I think i am on the right track, but..........

Attached follows the full project.

Below follows the log:

Code: Select all

Checking Python dependencies...
Python requirements from c:\esp-idf\requirements.txt are satisfied.
Executing action: all (aliases: build)
Running cmake in directory c:\esp32projects\esp32_ili9341-master\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 --warn-uninitialized -DCCACHE_ENABLE=0 c:\esp32projects\esp32_ili9341-master"...
Warn about uninitialized values.
CMake Warning at C:/esp-idf/tools/cmake/idf.cmake:14 (message):
  IDF_PATH environment variable is different from inferred IDF_PATH.

                              Check if your project's top-level CMakeLists.txt includes the right
                              CMake files. Environment IDF_PATH will be used for the build.      
Call Stack (most recent call first):
  C:/esp-idf/tools/cmake/project.cmake:7 (include)
  CMakeLists.txt:5 (include)


-- Found Git: C:/Git/cmd/git.exe (found version "2.23.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:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-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:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe
-- Check for working CXX compiler: C:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-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:/Program Files (x86)/Microsoft Visual Studio/Shared/Python37_64/python.exe (found version "3.7.2")
-- Could NOT find Perl (missing: PERL_EXECUTABLE)
-- Adding linker script C:/esp32Projects/esp32_ili9341-master/build/esp-idf/esp32/esp32_out.ld
-- Adding linker script C:/esp-idf/components/esp32/ld/esp32.project.ld.in
-- Adding linker script C:/esp-idf/components/esp32/ld/esp32.peripherals.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
-- Components: app_trace app_update asio bootloader bootloader_support bt cbor coap console 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 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:/esp-idf/components/app_trace C:/esp-idf/components/app_update C:/esp-idf/components/asio C:/esp-idf/components/bootloader C:/esp-idf/components/bootloader_support C:/esp-idf/components/bt C:/esp-idf/components/cbor C:/esp-idf/components/coap C:/esp-idf/components/console C:/esp-idf/components/cxx C:/esp-idf/components/driver C:/esp-idf/components/efuse C:/esp-idf/components/esp-tls C:/esp-idf/components/esp32 C:/esp-idf/components/esp_adc_cal C:/esp-idf/components/esp_common C:/esp-idf/components/esp_eth C:/esp-idf/components/esp_event C:/esp-idf/components/esp_gdbstub C:/esp-idf/components/esp_http_client C:/esp-idf/components/esp_http_server C:/esp-idf/components/esp_https_ota C:/esp-idf/components/esp_https_server C:/esp-idf/components/esp_local_ctrl C:/esp-idf/components/esp_ringbuf C:/esp-idf/components/esp_rom C:/esp-idf/components/esp_websocket_client C:/esp-idf/components/esp_wifi C:/esp-idf/components/espcoredump C:/esp-idf/components/esptool_py C:/esp-idf/components/expat C:/esp-idf/components/fatfs C:/esp-idf/components/freemodbus C:/esp-idf/components/freertos C:/esp-idf/components/heap C:/esp-idf/components/idf_test C:/esp-idf/components/jsmn C:/esp-idf/components/json C:/esp-idf/components/libsodium C:/esp-idf/components/log C:/esp-idf/components/lwip C:/esp32Projects/esp32_ili9341-master/main C:/esp-idf/components/mbedtls C:/esp-idf/components/mdns C:/esp-idf/components/mqtt C:/esp-idf/components/newlib C:/esp-idf/components/nghttp C:/esp-idf/components/nvs_flash C:/esp-idf/components/openssl C:/esp-idf/components/partition_table C:/esp-idf/components/protobuf-c C:/esp-idf/components/protocomm C:/esp-idf/components/pthread C:/esp-idf/components/sdmmc C:/esp-idf/components/soc C:/esp-idf/components/spi_flash C:/esp-idf/components/spiffs C:/esp-idf/components/tcp_transport C:/esp-idf/components/tcpip_adapter C:/esp-idf/components/ulp C:/esp-idf/components/unity C:/esp-idf/components/vfs C:/esp-idf/components/wear_levelling C:/esp-idf/components/wifi_provisioning C:/esp-idf/components/wpa_supplicant C:/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: C:/esp32Projects/esp32_ili9341-master/build
Running ninja in directory c:\esp32projects\esp32_ili9341-master\build
Executing "ninja all"...
[638/834] Performing configure step for 'bootloader'
CMake Warning at C:/esp-idf/tools/cmake/idf.cmake:14 (message):
  IDF_PATH environment variable is different from inferred IDF_PATH.

                              Check if your project's top-level CMakeLists.txt includes the right
                              CMake files. Environment IDF_PATH will be used for the build.
Call Stack (most recent call first):
  C:/esp-idf/tools/cmake/project.cmake:7 (include)
  CMakeLists.txt:20 (include)


-- Found Git: C:/Git/cmd/git.exe (found version "2.23.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:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-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:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe
-- Check for working CXX compiler: C:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-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.1-dev-141-ga7e8d87d3
-- Building ESP-IDF components for target esp32
-- Adding linker script C:/esp-idf/components/esp32/ld/esp32.peripherals.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script C:/esp-idf/components/bootloader/subproject/main/esp32.bootloader.ld
-- Adding linker script C:/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:/esp-idf/components/bootloader C:/esp-idf/components/bootloader_support C:/esp-idf/components/efuse C:/esp-idf/components/esp32 C:/esp-idf/components/esp_common C:/esp-idf/components/esp_rom C:/esp-idf/components/esptool_py C:/esp-idf/components/log C:/esp-idf/components/bootloader/subproject/main C:/esp-idf/components/bootloader/subproject/components/micro-ecc C:/esp-idf/components/partition_table C:/esp-idf/components/soc C:/esp-idf/components/spi_flash C:/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: C:/esp32Projects/esp32_ili9341-master/build/bootloader
[711/834] Performing build step for 'bootloader'
[1/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/gpio_periph.c.obj
[2/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_periph.c.obj
[3/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_pm.c.obj
[4/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_clk_init.c.obj
[5/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_init.c.obj
[6/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_clk.c.obj
[7/62] Generating project_elf_src.c
[8/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/cpu_util.c.obj
[9/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_slave_hal_iram.c.obj
[10/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/lldesc.c.obj
[11/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_hal_iram.c.obj
[12/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_slave_hal.c.obj
[13/62] Building C object CMakeFiles/bootloader.elf.dir/project_elf_src.c.obj
[14/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_hal.c.obj
[15/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/soc_memory_layout.c.obj
[16/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/sdio_slave_periph.c.obj
[17/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_wdt.c.obj
[18/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_sleep.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/memory_layout_utils.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/esp32/spi_periph.c.obj
[23/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_time.c.obj
[24/62] Building C object esp-idf/xtensa/CMakeFiles/__idf_xtensa.dir/eri.c.obj
[25/62] Building C object esp-idf/xtensa/CMakeFiles/__idf_xtensa.dir/debug_helpers.c.obj
[26/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_flash_hal_iram.c.obj
[27/62] Building C object esp-idf/xtensa/CMakeFiles/__idf_xtensa.dir/trax.c.obj
[28/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_flash_hal.c.obj
[29/62] Building ASM object esp-idf/xtensa/CMakeFiles/__idf_xtensa.dir/debug_helpers_asm.S.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/efuse/CMakeFiles/__idf_efuse.dir/src/esp_efuse_api.c.obj
[33/62] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/esp32/esp_efuse_table.c.obj
[34/62] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/src/esp_efuse_fields.c.obj
[35/62] Building C object esp-idf/micro-ecc/CMakeFiles/__idf_micro-ecc.dir/micro-ecc/uECC.c.obj
[36/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_clock.c.obj
[37/62] Linking C static library esp-idf\log\liblog.a
[38/62] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/src/esp_efuse_utility.c.obj
[39/62] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/bootloader_start.c.obj
[40/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_flash_config.c.obj
[41/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_flash.c.obj
[42/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_common.c.obj
[43/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_random.c.obj
[44/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/flash_partitions.c.obj
[45/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_utility.c.obj
[46/62] Linking C static library esp-idf\xtensa\libxtensa.a
[47/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/flash_qio_mode.c.obj
[48/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp_image_format.c.obj
[49/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/flash_encrypt.c.obj
[50/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32/secure_boot.c.obj
[51/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_init.c.obj
[52/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32/flash_encrypt.c.obj
[53/62] Linking C static library esp-idf\soc\libsoc.a
[54/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32/secure_boot_signatures.c.obj
[55/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32/bootloader_sha.c.obj
[56/62] Linking C static library esp-idf\micro-ecc\libmicro-ecc.a
[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-dev
Generated C:/esp32Projects/esp32_ili9341-master/build/bootloader/bootloader.bin
[833/834] Linking CXX executable esp32-ili9341-master.elf
FAILED: esp32-ili9341-master.elf
cmd.exe /C "cd . && C:\esp-idf\tools\tools\xtensa-esp32-elf\esp32-2019r1-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe  -mlongcalls -Wno-frame-address  -nostdlib @CMakeFiles\esp32-ili9341-master.elf.rsp  -o esp32-ili9341-master.elf  && cd ."
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.iram1.5.literal+0x0): undefined reference to `lv_tick_inc'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x10): undefined reference to `ili9341_flush'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x18): undefined reference to `lv_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x1c): undefined reference to `disp_spi_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x20): undefined reference to `ili9341_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x24): undefined reference to `tp_spi_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x28): undefined reference to `xpt2046_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x2c): undefined reference to `lv_disp_buf_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x30): undefined reference to `lv_disp_drv_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x34): undefined reference to `lv_disp_drv_register'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x38): undefined reference to `demo_create'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x3c): undefined reference to `lv_task_handler'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `lv_tick_task':
c:\esp32projects\esp32_ili9341-master\build/../main/main.c:81: undefined reference to `lv_tick_inc'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `app_main':
c:\esp32projects\esp32_ili9341-master\build/../main/main.c:35: undefined reference to `lv_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:37: undefined reference to `disp_spi_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:38: undefined reference to `ili9341_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:40: undefined reference to `tp_spi_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:41: undefined reference to `xpt2046_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:46: undefined reference to `lv_disp_buf_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:49: undefined reference to `lv_disp_drv_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:52: undefined reference to `lv_disp_drv_register'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:65: undefined reference to `demo_create'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:71: undefined reference to `lv_task_handler'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

Thank's for the help.
Attachments
esp32_ili9341-master.zip
Full project with include paths corrected
(2.49 MiB) Downloaded 684 times

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

Re: How to create "complex" project structures ?

Postby ESP_Angus » Wed Sep 11, 2019 1:32 am

Usually undefined symbol errors in the linker output mean that some source files were not added into the build.

These two lines in the CMake output are useful because they show which components are included in the build:

Code: Select all

-- Components: app_trace app_update asio bootloader bootloader_support bt cbor coap console 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 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:/esp-idf/components/app_trace C:/esp-idf/components/app_update C:/esp-idf/components/asio C:/esp-idf/components/bootloader C:/esp-idf/components/bootloader_support C:/esp-idf/components/bt C:/esp-idf/components/cbor C:/esp-idf/components/coap C:/esp-idf/components/console C:/esp-idf/components/cxx C:/esp-idf/components/driver C:/esp-idf/components/efuse C:/esp-idf/components/esp-tls C:/esp-idf/components/esp32 C:/esp-idf/components/esp_adc_cal C:/esp-idf/components/esp_common C:/esp-idf/components/esp_eth C:/esp-idf/components/esp_event C:/esp-idf/components/esp_gdbstub C:/esp-idf/components/esp_http_client C:/esp-idf/components/esp_http_server C:/esp-idf/components/esp_https_ota C:/esp-idf/components/esp_https_server C:/esp-idf/components/esp_local_ctrl C:/esp-idf/components/esp_ringbuf C:/esp-idf/components/esp_rom C:/esp-idf/components/esp_websocket_client C:/esp-idf/components/esp_wifi C:/esp-idf/components/espcoredump C:/esp-idf/components/esptool_py C:/esp-idf/components/expat C:/esp-idf/components/fatfs C:/esp-idf/components/freemodbus C:/esp-idf/components/freertos C:/esp-idf/components/heap C:/esp-idf/components/idf_test C:/esp-idf/components/jsmn C:/esp-idf/components/json C:/esp-idf/components/libsodium C:/esp-idf/components/log C:/esp-idf/components/lwip C:/esp32Projects/esp32_ili9341-master/main C:/esp-idf/components/mbedtls C:/esp-idf/components/mdns C:/esp-idf/components/mqtt C:/esp-idf/components/newlib C:/esp-idf/components/nghttp C:/esp-idf/components/nvs_flash C:/esp-idf/components/openssl C:/esp-idf/components/partition_table C:/esp-idf/components/protobuf-c C:/esp-idf/components/protocomm C:/esp-idf/components/pthread C:/esp-idf/components/sdmmc C:/esp-idf/components/soc C:/esp-idf/components/spi_flash C:/esp-idf/components/spiffs C:/esp-idf/components/tcp_transport C:/esp-idf/components/tcpip_adapter C:/esp-idf/components/ulp C:/esp-idf/components/unity C:/esp-idf/components/vfs C:/esp-idf/components/wear_levelling C:/esp-idf/components/wifi_provisioning C:/esp-idf/components/wpa_supplicant C:/esp-idf/components/xtensa
... I don't see any of your project's components here are apart from "main" so probably this is a clue.

When I download your new zip file, I see that you've moved all your components from the "components" directory to a "components/ui/..." subdirectory. This means the build system can no longer see them.

You have two options:
  • Move them back. By default, the build system will only see project components where the path looks like "components/<component name>/CMakeLists.txt". Any CMakeLists file in a subdirectory under this will not be seen.
  • Set the EXTRA_COMPONENT_DIRS variable in your project CMakeLists.txt file to the path to "components/ui". This will cause the build system to also search in this directory for components. See more info here: https://docs.espressif.com/projects/esp ... -variables . Some IDF examples do this, for example: https://github.com/espressif/esp-idf/bl ... sts.txt#L5 (note that they use IDF_PATH but you will want your path to be relative to CMAKE_SOURCE_DIR)

Baldhead
Posts: 471
Joined: Sun Mar 31, 2019 5:16 am

Re: How to create "complex" project structures ?

Postby Baldhead » Wed Sep 11, 2019 8:34 pm

Hi ESP_Angus,

I tried your suggestion(Set the EXTRA_COMPONENT_DIRS) and i still have the same problem.
The first suggestion i didn't even try because i need to change many include paths.

In annex follow the project.

Thank's.
Attachments
esp32_ili9341-master-11-09-2019.zip
(2.49 MiB) Downloaded 629 times

Baldhead
Posts: 471
Joined: Sun Mar 31, 2019 5:16 am

Re: How to create "complex" project structures ?

Postby Baldhead » Wed Sep 11, 2019 8:37 pm

I forgot to send the log,

Code: Select all

Checking Python dependencies...
Python requirements from c:\esp-idf\requirements.txt are satisfied.
Executing action: all (aliases: build)
Running cmake in directory c:\esp32projects\esp32_ili9341-master\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 --warn-uninitialized -DCCACHE_ENABLE=0 c:\esp32projects\esp32_ili9341-master"...
Warn about uninitialized values.
CMake Warning at C:/esp-idf/tools/cmake/idf.cmake:14 (message):
  IDF_PATH environment variable is different from inferred IDF_PATH.

                              Check if your project's top-level CMakeLists.txt includes the right
                              CMake files. Environment IDF_PATH will be used for the build.
Call Stack (most recent call first):
  C:/esp-idf/tools/cmake/project.cmake:7 (include)
  CMakeLists.txt:9 (include)


-- Found Git: C:/Git/cmd/git.exe (found version "2.23.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:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-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:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe
-- Check for working CXX compiler: C:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-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:/Program Files (x86)/Microsoft Visual Studio/Shared/Python37_64/python.exe (found version "3.7.2")
-- Could NOT find Perl (missing: PERL_EXECUTABLE)
-- Adding linker script C:/esp32Projects/esp32_ili9341-master/build/esp-idf/esp32/esp32_out.ld
-- Adding linker script C:/esp-idf/components/esp32/ld/esp32.project.ld.in
-- Adding linker script C:/esp-idf/components/esp32/ld/esp32.peripherals.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
-- Components: app_trace app_update asio bootloader bootloader_support bt cbor coap console 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 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 ui ulp unity vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: C:/esp-idf/components/app_trace C:/esp-idf/components/app_update C:/esp-idf/components/asio C:/esp-idf/components/bootloader C:/esp-idf/components/bootloader_support C:/esp-idf/components/bt C:/esp-idf/components/cbor C:/esp-idf/components/coap C:/esp-idf/components/console C:/esp-idf/components/cxx C:/esp-idf/components/driver C:/esp-idf/components/efuse C:/esp-idf/components/esp-tls C:/esp-idf/components/esp32 C:/esp-idf/components/esp_adc_cal C:/esp-idf/components/esp_common C:/esp-idf/components/esp_eth C:/esp-idf/components/esp_event C:/esp-idf/components/esp_gdbstub C:/esp-idf/components/esp_http_client C:/esp-idf/components/esp_http_server C:/esp-idf/components/esp_https_ota C:/esp-idf/components/esp_https_server C:/esp-idf/components/esp_local_ctrl C:/esp-idf/components/esp_ringbuf C:/esp-idf/components/esp_rom C:/esp-idf/components/esp_websocket_client C:/esp-idf/components/esp_wifi C:/esp-idf/components/espcoredump C:/esp-idf/components/esptool_py C:/esp-idf/components/expat 
C:/esp-idf/components/fatfs C:/esp-idf/components/freemodbus C:/esp-idf/components/freertos C:/esp-idf/components/heap C:/esp-idf/components/idf_test C:/esp-idf/components/jsmn C:/esp-idf/components/json C:/esp-idf/components/libsodium C:/esp-idf/components/log C:/esp-idf/components/lwip C:/esp32Projects/esp32_ili9341-master/main C:/esp-idf/components/mbedtls C:/esp-idf/components/mdns C:/esp-idf/components/mqtt C:/esp-idf/components/newlib C:/esp-idf/components/nghttp C:/esp-idf/components/nvs_flash C:/esp-idf/components/openssl C:/esp-idf/components/partition_table C:/esp-idf/components/protobuf-c C:/esp-idf/components/protocomm C:/esp-idf/components/pthread C:/esp-idf/components/sdmmc C:/esp-idf/components/soc C:/esp-idf/components/spi_flash C:/esp-idf/components/spiffs C:/esp-idf/components/tcp_transport C:/esp-idf/components/tcpip_adapter C:/esp32Projects/esp32_ili9341-master/components/ui C:/esp-idf/components/ulp C:/esp-idf/components/unity C:/esp-idf/components/vfs C:/esp-idf/components/wear_levelling C:/esp-idf/components/wifi_provisioning C:/esp-idf/components/wpa_supplicant C:/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: C:/esp32Projects/esp32_ili9341-master/build
Running ninja in directory c:\esp32projects\esp32_ili9341-master\build
Executing "ninja all"...
[332/835] Performing configure step for 'bootloader'
CMake Warning at C:/esp-idf/tools/cmake/idf.cmake:14 (message):
  IDF_PATH environment variable is different from inferred IDF_PATH.

                              Check if your project's top-level CMakeLists.txt includes the right
                              CMake files. Environment IDF_PATH will be used for the build.
Call Stack (most recent call first):
  C:/esp-idf/tools/cmake/project.cmake:7 (include)
  CMakeLists.txt:20 (include)


-- Found Git: C:/Git/cmd/git.exe (found version "2.23.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:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-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:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe
-- Check for working CXX compiler: C:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-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.1-dev-141-ga7e8d87d3
-- Building ESP-IDF components for target esp32
-- Adding linker script C:/esp-idf/components/esp32/ld/esp32.peripherals.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script C:/esp-idf/components/bootloader/subproject/main/esp32.bootloader.ld
-- Adding linker script C:/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:/esp-idf/components/bootloader C:/esp-idf/components/bootloader_support C:/esp-idf/components/efuse C:/esp-idf/components/esp32 C:/esp-idf/components/esp_common C:/esp-idf/components/esp_rom C:/esp-idf/components/esptool_py C:/esp-idf/components/log C:/esp-idf/components/bootloader/subproject/main C:/esp-idf/components/bootloader/subproject/components/micro-ecc C:/esp-idf/components/partition_table C:/esp-idf/components/soc C:/esp-idf/components/spi_flash C:/esp-idf/components/xtensa-- Configuring done
-- Generating done
-- Build files have been written to: C:/esp32Projects/esp32_ili9341-master/build/bootloader
[405/835] Performing build step for 'bootloader'
[1/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_periph.c.obj
[2/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_pm.c.obj
[3/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/gpio_periph.c.obj
[4/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_init.c.obj
[5/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_clk_init.c.obj
[6/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_clk.c.obj
[7/62] Generating project_elf_src.c
[8/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/cpu_util.c.obj
[9/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_hal.c.obj
[10/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/lldesc.c.obj
[11/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_hal_iram.c.obj
[12/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_slave_hal_iram.c.obj
[13/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_slave_hal.c.obj
[14/62] Building C object CMakeFiles/bootloader.elf.dir/project_elf_src.c.obj
[15/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/sdmmc_periph.c.obj
[16/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_time.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/esp32/rtc_wdt.c.obj
[19/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_sleep.c.obj
[20/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/sdio_slave_periph.c.obj
[21/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/memory_layout_utils.c.obj
[22/62] Building C object esp-idf/xtensa/CMakeFiles/__idf_xtensa.dir/trax.c.obj
[23/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/spi_periph.c.obj
[24/62] Building C object esp-idf/xtensa/CMakeFiles/__idf_xtensa.dir/eri.c.obj
[25/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_flash_hal_iram.c.obj
[26/62] Building C object esp-idf/xtensa/CMakeFiles/__idf_xtensa.dir/debug_helpers.c.obj
[27/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/hal/spi_flash_hal.c.obj
[28/62] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/src/soc_include_legacy_warn.c.obj
[29/62] Building ASM object esp-idf/xtensa/CMakeFiles/__idf_xtensa.dir/debug_helpers_asm.S.obj
[30/62] Building C object esp-idf/log/CMakeFiles/__idf_log.dir/log.c.obj
[31/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_clock.c.obj
[32/62] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/src/esp_efuse_api.c.obj
[33/62] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/src/esp_efuse_utility.c.obj
[34/62] Building C object esp-idf/spi_flash/CMakeFiles/__idf_spi_flash.dir/spi_flash_rom_patch.c.obj
[35/62] Building C object esp-idf/micro-ecc/CMakeFiles/__idf_micro-ecc.dir/micro-ecc/uECC.c.obj
[36/62] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/esp32/esp_efuse_table.c.obj
[37/62] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/bootloader_start.c.obj
[38/62] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/src/esp_efuse_fields.c.obj
[39/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_random.c.obj
[40/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_flash.c.obj
[41/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_flash_config.c.obj
[42/62] Linking C static library esp-idf\log\liblog.a
[43/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_common.c.obj
[44/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_utility.c.obj
[45/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/flash_partitions.c.obj
[46/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/flash_encrypt.c.obj
[47/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/flash_qio_mode.c.obj
[48/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp_image_format.c.obj
[49/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_init.c.obj
[50/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32/bootloader_sha.c.obj
[51/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32/secure_boot_signatures.c.obj
[52/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32/secure_boot.c.obj
[53/62] Linking C static library esp-idf\xtensa\libxtensa.a
[54/62] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32/flash_encrypt.c.obj
[55/62] Linking C static library esp-idf\soc\libsoc.a
[56/62] Linking C static library esp-idf\micro-ecc\libmicro-ecc.a
[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-dev
Generated C:/esp32Projects/esp32_ili9341-master/build/bootloader/bootloader.bin
[834/835] Linking CXX executable esp32-ili9341-master.elf
FAILED: esp32-ili9341-master.elf
cmd.exe /C "cd . && C:\esp-idf\tools\tools\xtensa-esp32-elf\esp32-2019r1-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe  -mlongcalls -Wno-frame-address  -nostdlib @CMakeFiles\esp32-ili9341-master.elf.rsp  -o esp32-ili9341-master.elf  && cd ."
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.iram1.5.literal+0x0): undefined reference to `lv_tick_inc'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x10): undefined reference to `ili9341_flush'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x18): undefined reference to `lv_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x1c): undefined reference to `disp_spi_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x20): undefined reference to `ili9341_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x24): undefined reference to `tp_spi_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x28): undefined reference to `xpt2046_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x2c): undefined reference to `lv_disp_buf_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x30): undefined reference to `lv_disp_drv_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x34): undefined reference to `lv_disp_drv_register'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x38): undefined reference to `demo_create'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x3c): undefined reference to `lv_task_handler'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `lv_tick_task':
c:\esp32projects\esp32_ili9341-master\build/../main/main.c:81: undefined reference to `lv_tick_inc'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `app_main':
c:\esp32projects\esp32_ili9341-master\build/../main/main.c:35: undefined reference to `lv_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:37: undefined reference to `disp_spi_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:38: undefined reference to `ili9341_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:40: undefined reference to `tp_spi_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:41: undefined reference to `xpt2046_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:46: undefined reference to `lv_disp_buf_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:49: undefined reference to `lv_disp_drv_init'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:52: undefined reference to `lv_disp_drv_register'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:65: undefined reference to `demo_create'
c:/esp-idf/tools/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:\esp32projects\esp32_ili9341-master\build/../main/main.c:71: undefined reference to `lv_task_handler'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.


Baldhead
Posts: 471
Joined: Sun Mar 31, 2019 5:16 am

Re: How to create "complex" project structures ?

Postby Baldhead » Thu Sep 12, 2019 2:19 am

Hi,

Now i am trying like the project in annex, and not build yet.
I followed some tips from techtoys on littlevgl forum.

Code: Select all

Checking Python dependencies...
Python requirements from c:\esp-idf\requirements.txt are satisfied.
Executing action: all (aliases: build)
Running ninja in directory c:\esp32projects\esp32_ili9341-master\build
Executing "ninja all"...
[498/987] Performing configure step for 'bootloader'
CMake Warning at C:/esp-idf/tools/cmake/idf.cmake:14 (message):
  IDF_PATH environment variable is different from inferred IDF_PATH.

                              Check if your project's top-level CMakeLists.txt includes the right
                              CMake files. Environment IDF_PATH will be used for the build.
Call Stack (most recent call first):
  C:/esp-idf/tools/cmake/project.cmake:7 (include)
  CMakeLists.txt:20 (include)


-- mconf-idf version mconf-v4.6.0.0-idf-20190628-win32
-- Project version: v4.1-dev-141-ga7e8d87d3
-- Building ESP-IDF components for target esp32
-- Adding linker script C:/esp-idf/components/esp32/ld/esp32.peripherals.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script C:/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script C:/esp-idf/components/bootloader/subproject/main/esp32.bootloader.ld
-- Adding linker script C:/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:/esp-idf/components/bootloader C:/esp-idf/components/bootloader_support C:/esp-idf/components/efuse C:/esp-idf/components/esp32 C:/esp-idf/components/esp_common C:/esp-idf/components/esp_rom C:/esp-idf/components/esptool_py C:/esp-idf/components/log C:/esp-idf/components/bootloader/subproject/main C:/esp-idf/components/bootloader/subproject/components/micro-ecc C:/esp-idf/components/partition_table C:/esp-idf/components/soc C:/esp-idf/components/spi_flash C:/esp-idf/components/xtensa-- Configuring done
-- Generating done
-- Build files have been written to: C:/esp32Projects/esp32_ili9341-master/build/bootloader
[512/987] Performing build step for 'bootloader'
[1/2] Linking C executable bootloader.elf
[2/2] Generating binary image from built executable
esptool.py v2.8-dev
Generated C:/esp32Projects/esp32_ili9341-master/build/bootloader/bootloader.bin
[828/987] Building C object esp-idf/ui/CMakeFiles/__idf_ui.dir/drv/ili9341.c.obj
FAILED: esp-idf/ui/CMakeFiles/__idf_ui.dir/drv/ili9341.c.obj 
C:\esp-idf\tools\tools\xtensa-esp32-elf\esp32-2019r1-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe  -Iconfig -I../components/ui/drv -I../components/ui/lv_examples -I../components/ui/lvgl -IC:/esp-idf/components/newlib/platform_include -IC:/esp-idf/components/freertos/include -IC:/esp-idf/components/heap/include -IC:/esp-idf/components/log/include -IC:/esp-idf/components/soc/esp32/include -IC:/esp-idf/components/soc/include -IC:/esp-idf/components/esp_rom/include -IC:/esp-idf/components/esp_common/include -IC:/esp-idf/components/xtensa/include -IC:/esp-idf/components/xtensa/esp32/include -IC:/esp-idf/components/esp32/include -IC:/esp-idf/components/driver/include -IC:/esp-idf/components/esp_ringbuf/include -IC:/esp-idf/components/esp_event/include -IC:/esp-idf/components/tcpip_adapter/include -IC:/esp-idf/components/lwip/include/apps -IC:/esp-idf/components/lwip/include/apps/sntp -IC:/esp-idf/components/lwip/lwip/src/include -IC:/esp-idf/components/lwip/port/esp32/include -IC:/esp-idf/components/lwip/port/esp32/include/arch -IC:/esp-idf/components/vfs/include -IC:/esp-idf/components/esp_wifi/include -IC:/esp-idf/components/esp_wifi/esp32/include -IC:/esp-idf/components/esp_eth/include -IC:/esp-idf/components/efuse/include -IC:/esp-idf/components/efuse/esp32/include -IC:/esp-idf/components/app_trace/include -IC:/esp-idf/components/fatfs/diskio -IC:/esp-idf/components/fatfs/vfs -IC:/esp-idf/components/fatfs/src -IC:/esp-idf/components/wear_levelling/include -IC:/esp-idf/components/spi_flash/include -IC:/esp-idf/components/sdmmc/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 -mfix-esp32-psram-cache-issue -Og -std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER=\"v4.1-dev-141-ga7e8d87d3\" -DGCC_NOT_5_2_0 -DESP_PLATFORM -MD -MT esp-idf/ui/CMakeFiles/__idf_ui.dir/drv/ili9341.c.obj -MF esp-idf\ui\CMakeFiles\__idf_ui.dir\drv\ili9341.c.obj.d -o esp-idf/ui/CMakeFiles/__idf_ui.dir/drv/ili9341.c.obj   -c ../components/ui/drv/ili9341.c
In file included from ../components/ui/drv/ili9341.c:9:
../components/ui/drv/include/ili9341.h:17:10: fatal error: ../components/ui/lvgl/lvgl.h: No such file or directory
 #include "../components/ui/lvgl/lvgl.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[831/987] Building C object esp-idf/ui/CMakeFiles/__idf_ui.dir/drv/xpt2046.c.obj
FAILED: esp-idf/ui/CMakeFiles/__idf_ui.dir/drv/xpt2046.c.obj 
C:\esp-idf\tools\tools\xtensa-esp32-elf\esp32-2019r1-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe  -Iconfig -I../components/ui/drv -I../components/ui/lv_examples -I../components/ui/lvgl -IC:/esp-idf/components/newlib/platform_include -IC:/esp-idf/components/freertos/include -IC:/esp-idf/components/heap/include -IC:/esp-idf/components/log/include -IC:/esp-idf/components/soc/esp32/include -IC:/esp-idf/components/soc/include -IC:/esp-idf/components/esp_rom/include -IC:/esp-idf/components/esp_common/include -IC:/esp-idf/components/xtensa/include -IC:/esp-idf/components/xtensa/esp32/include -IC:/esp-idf/components/esp32/include -IC:/esp-idf/components/driver/include -IC:/esp-idf/components/esp_ringbuf/include -IC:/esp-idf/components/esp_event/include -IC:/esp-idf/components/tcpip_adapter/include -IC:/esp-idf/components/lwip/include/apps -IC:/esp-idf/components/lwip/include/apps/sntp -IC:/esp-idf/components/lwip/lwip/src/include -IC:/esp-idf/components/lwip/port/esp32/include -IC:/esp-idf/components/lwip/port/esp32/include/arch -IC:/esp-idf/components/vfs/include -IC:/esp-idf/components/esp_wifi/include -IC:/esp-idf/components/esp_wifi/esp32/include -IC:/esp-idf/components/esp_eth/include -IC:/esp-idf/components/efuse/include -IC:/esp-idf/components/efuse/esp32/include -IC:/esp-idf/components/app_trace/include -IC:/esp-idf/components/fatfs/diskio -IC:/esp-idf/components/fatfs/vfs -IC:/esp-idf/components/fatfs/src -IC:/esp-idf/components/wear_levelling/include -IC:/esp-idf/components/spi_flash/include -IC:/esp-idf/components/sdmmc/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 -mfix-esp32-psram-cache-issue -Og -std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER=\"v4.1-dev-141-ga7e8d87d3\" -DGCC_NOT_5_2_0 -DESP_PLATFORM -MD -MT esp-idf/ui/CMakeFiles/__idf_ui.dir/drv/xpt2046.c.obj -MF esp-idf\ui\CMakeFiles\__idf_ui.dir\drv\xpt2046.c.obj.d -o esp-idf/ui/CMakeFiles/__idf_ui.dir/drv/xpt2046.c.obj   -c ../components/ui/drv/xpt2046.c
In file included from ../components/ui/drv/xpt2046.c:9:
../components/ui/drv/include/xpt2046.h:19:10: fatal error: ../components/ui/lvgl/lvgl.h: No such file or directory
 #include "../components/ui/lvgl/lvgl.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[832/987] Building C object esp-idf/ui/CMakeFiles/__idf_ui.dir/drv/disp_spi.c.obj
FAILED: esp-idf/ui/CMakeFiles/__idf_ui.dir/drv/disp_spi.c.obj
C:\esp-idf\tools\tools\xtensa-esp32-elf\esp32-2019r1-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe  -Iconfig -I../components/ui/drv -I../components/ui/lv_examples -I../components/ui/lvgl -IC:/esp-idf/components/newlib/platform_include -IC:/esp-idf/components/freertos/include -IC:/esp-idf/components/heap/include -IC:/esp-idf/components/log/include -IC:/esp-idf/components/soc/esp32/include -IC:/esp-idf/components/soc/include -IC:/esp-idf/components/esp_rom/include -IC:/esp-idf/components/esp_common/include -IC:/esp-idf/components/xtensa/include -IC:/esp-idf/components/xtensa/esp32/include -IC:/esp-idf/components/esp32/include -IC:/esp-idf/components/driver/include -IC:/esp-idf/components/esp_ringbuf/include -IC:/esp-idf/components/esp_event/include -IC:/esp-idf/components/tcpip_adapter/include -IC:/esp-idf/components/lwip/include/apps -IC:/esp-idf/components/lwip/include/apps/sntp -IC:/esp-idf/components/lwip/lwip/src/include -IC:/esp-idf/components/lwip/port/esp32/include -IC:/esp-idf/components/lwip/port/esp32/include/arch -IC:/esp-idf/components/vfs/include -IC:/esp-idf/components/esp_wifi/include -IC:/esp-idf/components/esp_wifi/esp32/include -IC:/esp-idf/components/esp_eth/include -IC:/esp-idf/components/efuse/include -IC:/esp-idf/components/efuse/esp32/include -IC:/esp-idf/components/app_trace/include -IC:/esp-idf/components/fatfs/diskio -IC:/esp-idf/components/fatfs/vfs -IC:/esp-idf/components/fatfs/src -IC:/esp-idf/components/wear_levelling/include -IC:/esp-idf/components/spi_flash/include -IC:/esp-idf/components/sdmmc/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 -mfix-esp32-psram-cache-issue -Og -std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER=\"v4.1-dev-141-ga7e8d87d3\" -DGCC_NOT_5_2_0 -DESP_PLATFORM -MD -MT esp-idf/ui/CMakeFiles/__idf_ui.dir/drv/disp_spi.c.obj -MF esp-idf\ui\CMakeFiles\__idf_ui.dir\drv\disp_spi.c.obj.d -o esp-idf/ui/CMakeFiles/__idf_ui.dir/drv/disp_spi.c.obj   -c ../components/ui/drv/disp_spi.c
../components/ui/drv/disp_spi.c:17:10: fatal error: ../components/ui/lvgl/lvgl.h: No such file or directory
 #include "../components/ui/lvgl/lvgl.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[833/987] Linking CXX static library esp-idf\wifi_provisioning\libwifi_provisioning.a
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.
Attachments
esp32_ili9341-master.zip
(2.47 MiB) Downloaded 628 times

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

Re: How to create "complex" project structures ?

Postby ESP_Angus » Thu Sep 12, 2019 9:00 am

You shouldn't have to make this kind of change in your code:

Code: Select all

 #include "../components/ui/lvgl/lvgl.h"
 
The way the build system is designed, if one component REQUIRES the other component, you can just #include their headers without needing any special paths. The exact location in the filesystem should be irrelevant.

If this kind of path hacking is needed to include a header, it means that component isn't being found by the build system properly (see previous post) or one component doesn't REQUIRE the other component (probably not the case here as this looks like this is in the "main" component which automatically REQUIRES all the other component).

And because the component isn't actually included in the build, linking fails.

Sorry I don't have the time to go through the rest of the zip file. Suggest first making sure that all components are listed in the build output (see previous post), then remove all these path hacks and add REQUIRES for any component that needs to include headers from another component, and then work on any additional build failures from there.

If confused, checking the examples (like the ones I've linked above) may help.

Who is online

Users browsing this forum: igormoo and 156 guests