Linker error - Undefined reference after update ESP-IDF to v4
Posted: Fri May 17, 2019 8:19 am
<t>Hi,<br/>
<br/>
After updating the ESP-IDF to the latest master I can't compile my code anymore: "ld returned 1 exit status".<br/>
Various undefined references are provided.<br/>
I tried to roll back to v3.1.1 which worked before, but that doesn't work anymore. The same errors are there.<br/>
I use Linux(Ubuntu 18.10) + Eclipse to code and compile with gcc 4.2.1<br/>
Steps to eliminate the error:<br/>
1. Remove old ESP-IDF folder<br/>
2. Cloned the latest master-branche to "/home/<user>/esp-idf"<br/>
3. Added the esp-idf to the $IDF_PATH env.variable<br/>
3. Removed my project in Eclipse<br/>
4. (re)Import the project in Eclipse<br/>
5. Setup the Project-properties according to the docs from Espressif.<br/>
6. Create Build targets in Eclipse: clean + all<br/>
7. Perform Make Clean<br/>
8. Make menuconfig from the console (I do have some custom CONFIG parameters in Kconfig.projbuild)<br/>
9. Make all<br/>
<br/>
The compilation fails on Undefined References to....<br/>
<br/>
Any help is appreciated......
Output from compiler:</t>
<br/>
After updating the ESP-IDF to the latest master I can't compile my code anymore: "ld returned 1 exit status".<br/>
Various undefined references are provided.<br/>
I tried to roll back to v3.1.1 which worked before, but that doesn't work anymore. The same errors are there.<br/>
I use Linux(Ubuntu 18.10) + Eclipse to code and compile with gcc 4.2.1<br/>
Steps to eliminate the error:<br/>
1. Remove old ESP-IDF folder<br/>
2. Cloned the latest master-branche to "/home/<user>/esp-idf"<br/>
3. Added the esp-idf to the $IDF_PATH env.variable<br/>
3. Removed my project in Eclipse<br/>
4. (re)Import the project in Eclipse<br/>
5. Setup the Project-properties according to the docs from Espressif.<br/>
6. Create Build targets in Eclipse: clean + all<br/>
7. Perform Make Clean<br/>
8. Make menuconfig from the console (I do have some custom CONFIG parameters in Kconfig.projbuild)<br/>
9. Make all<br/>
<br/>
The compilation fails on Undefined References to....<br/>
<br/>
Any help is appreciated......
Output from compiler:</t>
Toolchain path: /home/kees/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: crosstool-ng-1.22.0-80-g6c4433a
Compiler version: 5.2.0
Python requirements from /home/kees/esp/esp-idf4/esp-idf/requirements.txt are satisfied.
Project is not inside a git repository, will not use 'git describe' to determine PROJECT_VER.
App "ESP32-Interface" version: 1
LD build/ESP32-Interface.elf
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o):(.literal.saveAppSettingsToNVS+0x8): undefined reference to `deviceInfo'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o):(.literal.initWifi+0x40): undefined reference to `initialise_wifi'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o):(.literal.initWifi+0x44): undefined reference to `ssd1306_startRegularWifi'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o):(.literal.initWifi+0x48): undefined reference to `clear_oled'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o):(.literal.initWifi+0x4c): undefined reference to `ssd1306_wifiScreen'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o):(.literal.initMCP23018+0x2c): undefined reference to `mcp23018_write_register'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o):(.literal.initMCP23018+0x30): undefined reference to `mcp23018_read_register'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o):(.literal.app_main+0x60): undefined reference to `ssd1306_taskhandler'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o):(.literal.app_main+0x7c): undefined reference to `azure_taskhandler'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o):(.literal.app_main+0x8c): undefined reference to `status_startup'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o):(.literal.app_main+0xa0): undefined reference to `spi_master_initialize'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o):(.literal.app_main+0xa4): undefined reference to `i2c_master_init'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o):(.literal.app_main+0xa8): undefined reference to `ssd1306_startscreen'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o): In function `initWifi':
/home/kees/ESP32_Eclipse/Interface/main/interface_main.c:181: undefined reference to `initialise_wifi'
/home/kees/ESP32_Eclipse/Interface/main/interface_main.c:183: undefined reference to `ssd1306_startRegularWifi'
/home/kees/ESP32_Eclipse/Interface/main/interface_main.c:198: undefined reference to `initialise_wifi'
/home/kees/ESP32_Eclipse/Interface/main/interface_main.c:206: undefined reference to `clear_oled'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o): In function `xTaskCreate':
/home/kees/esp/esp-idf4/esp-idf/components/freertos/include/freertos/task.h:440: undefined reference to `ssd1306_wifiScreen'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o): In function `initMCP23018':
/home/kees/ESP32_Eclipse/Interface/main/interface_main.c:294: undefined reference to `mcp23018_write_register'
/home/kees/ESP32_Eclipse/Interface/main/interface_main.c:335: undefined reference to `mcp23018_read_register'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(interface_main.o): In function `app_main':
/home/kees/ESP32_Eclipse/Interface/main/interface_main.c:650: undefined reference to `spi_master_initialize'
/home/kees/ESP32_Eclipse/Interface/main/interface_main.c:655: undefined reference to `i2c_master_init'
/home/kees/ESP32_Eclipse/Interface/main/interface_main.c:672: undefined reference to `ssd1306_startscreen'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o):(.literal.readID+0x10): undefined reference to `ds28e05_read_single_byte'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o):(.literal.check_modules_taskhandler+0x1c): undefined reference to `sht31_taskhandler'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o):(.literal.check_modules_taskhandler+0x28): undefined reference to `mpl3115a2_taskhandler'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o):(.literal.check_modules_taskhandler+0x38): undefined reference to `status_taskhandler'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o):(.literal.check_modules_taskhandler+0x70): undefined reference to `forceModuleRescan'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o):(.literal.check_modules_taskhandler+0xe0): undefined reference to `thermocouple_board_taskhandler'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o):(.literal.check_modules_taskhandler+0xe4): undefined reference to `thermometerStatus'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o):(.literal.check_modules_taskhandler+0xe8): undefined reference to `thermometer_taskhandler'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o):(.literal.check_modules_taskhandler+0xf0): undefined reference to `pressuresensor_board_taskhandler'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o):(.literal.check_modules_taskhandler+0xf8): undefined reference to `rs485_board_taskhandler'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o):(.literal.check_modules_taskhandler+0x100): undefined reference to `eight_channel_adc_board_taskhandler'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o):(.literal.check_modules_taskhandler+0x108): undefined reference to `highres_adc_taskhandler'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o):(.literal.check_modules_taskhandler+0x11c): undefined reference to `status_sendImmediately'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o):(.literal.check_modules_taskhandler+0x120): undefined reference to `draw_string_oled'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o):(.literal.check_modules_taskhandler+0x124): undefined reference to `ds28e05_skipRom'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o):(.literal.check_modules_taskhandler+0x128): undefined reference to `vTaskList'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o): In function `setCS':
/home/kees/ESP32_Eclipse/Interface/main/modules.c:658: undefined reference to `mcp23018_write_register'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o): In function `setGL':
/home/kees/ESP32_Eclipse/Interface/main/modules.c:658: undefined reference to `mcp23018_write_register'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o): In function `readID':
/home/kees/ESP32_Eclipse/Interface/main/modules.c:668: undefined reference to `ds28e05_read_single_byte'
/home/kees/ESP32_Eclipse/Interface/main/modules.c:671: undefined reference to `ds28e05_read_single_byte'
/home/kees/ESP32_Eclipse/Interface/main/modules.c:674: undefined reference to `ds28e05_read_single_byte'
/home/kees/ESP32_Eclipse/Interface/build/main/libmain.a(modules.o): In function `check_modules_taskhandler':
/home/kees/ESP32_Eclipse/Interface/main/modules.c:143: undefined reference to `mcp23018_read_register'
/home/kees/ESP32_Eclipse/Interface/main/modules.c:194: undefined reference to `status_sendImmediately'
/home/kees/ESP32_Eclipse/Interface/main/modules.c:262: undefined reference to `mcp23018_read_register'
/home/kees/ESP32_Eclipse/Interface/main/modules.c:273: undefined reference to `mcp23018_read_register'
/home/kees/ESP32_Eclipse/Interface/main/modules.c:287: undefined reference to `mcp23018_read_register'
/home/kees/ESP32_Eclipse/Interface/main/modules.c:340: undefined reference to `draw_string_oled'
/home/kees/ESP32_Eclipse/Interface/main/modules.c:388: undefined reference to `ds28e05_skipRom'
/home/kees/ESP32_Eclipse/Interface/main/modules.c:483: undefined reference to `draw_string_oled'
/home/kees/ESP32_Eclipse/Interface/main/modules.c:488: undefined reference to `vTaskList'
collect2: error: ld returned 1 exit status
make: *** [/home/kees/esp/esp-idf4/esp-idf/make/project.mk:521: /home/kees/ESP32_Eclipse/Interface/build/ESP32-Interface.elf] Error 1