Adding ug82 to example project .. undefined reference to

leo876
Posts: 5
Joined: Mon Feb 01, 2021 2:50 pm

Adding ug82 to example project .. undefined reference to

Postby leo876 » Mon Feb 01, 2021 3:04 pm

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
Attachments
hello_world_main.c
(2.1 KiB) Downloaded 342 times
file_setup.png
file_setup.png (103.91 KiB) Viewed 3517 times

Mike.Ochtman
Posts: 3
Joined: Wed Feb 10, 2021 3:27 pm

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

Postby Mike.Ochtman » Wed Feb 10, 2021 6:40 pm

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.

leo876
Posts: 5
Joined: Mon Feb 01, 2021 2:50 pm

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

Postby leo876 » Fri Feb 19, 2021 2:46 pm

Many thanks

Who is online

Users browsing this forum: No registered users and 300 guests