Page 1 of 1

Adding ug82 to example project .. undefined reference to

Posted: Mon Feb 01, 2021 3:04 pm
by leo876
Hello All,

Just starting with ESP-IDF..

I got my setup going, Linux Mint with Eclipse & the ESP-IDF plugin. I successfully compiled the Hello World example that comes with the ESP-IDF & then tried adding the ug82 library with the HAL (from https://github.com/nkolban/esp32-snippe ... plays/U8G2) . I followed the instructions but am getting the errors:

/.espressif/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/main/libmain.a(hello_world_main.c.obj):(.literal.app_main+0x1c): undefined reference to `u8g2_esp32_gpio_and_delay_cb'
undefined reference to `u8g2_esp32_i2c_byte_cb'
undefined reference to `u8g2_esp32_hal_init'

I've tried clean & full clean, command line build but no joy.

My main file is attached & file structure is attached.

Any help to someone getting started is appreciated!

Leo

Re: Adding ug82 to example project .. undefined reference to

Posted: Wed Feb 10, 2021 6:40 pm
by Mike.Ochtman
It could be a problem with main/CmakeLists.txt that has not been made aware there is anything more than hello_world_main.c in that folder.

Edit to to be
idf_component_register(SRCS "hello_world_main.c" "u8g2_esp32_hal.c"
INCLUDE_DIRS ".")

That should help.

Re: Adding ug82 to example project .. undefined reference to

Posted: Fri Feb 19, 2021 2:46 pm
by leo876
Many thanks