I recently started using esp_idf 4.4 with cmake instead of make. I am an absolute beginner with using cmake and therefore have problems with it.
I have 2 components in a project ("ft813" and "gfx") and of course the "main" module. "main" calls "gfx", and "gfx" calls "ft813".
When I execute "idf.py build" I always get the following error message at the end:
Code: Select all
/opt/esp32/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/gfx/libgfx.a(gfx.c.obj):(.literal.gfx_init+0x0): undefined reference to `ft813_init'
/opt/esp32/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/gfx/libgfx.a(gfx.c.obj): in function `gfx_init':
/home/mick/Projects/ESP32/ft813/build/../components/gfx/gfx.c:27: undefined reference to `ft813_init'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
This is due to the order of the modules as they are passed to the linker. I've played with the entry "COMPONENT_REQUIRES" in the files "CMakeLists.txt" in "main" and "gfx", but it doesn't change anything.
I've tried unsuccessfully to find these informations in the ESP_IDF documentation and in the ES_IDF examples.
Can someone please show me how to do it right?
Thanks in advance,
Michael