• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

undefined references

Q&A Forum › Category: ESP32 › undefined references
0 Vote Up Vote Down
Paul Sanders asked 3 years ago

Several months ago I was studying “Building Web Servers ESP32 ESP8266 v2.1”. I was able to successfully build and run examples ‘1.1 – Hello World Web Server’ through and including ‘3.1 – Web Server: Display Sensor Readings (SSE)’ using VS Code and Platform IO. I learned a lot. Thank you both, Sara and Rui. I had to abandon my efforts for at least six months and am now getting back to the book and examples. I decided to spend some review time going over what I had accomplished six months prior. I loaded VSCode/PlatformIO and performed all of the updates I could find. I am now getting a error in all of the examples and I am not sure what I need to do. Here is the output from one of the samples,
****************************************************************************
> Executing task in folder 2_3_Control_Outputs: C:\Users\pauls\.platformio\penv\Scripts\platformio.exe run –environment esp32dev <
Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
——————————————————————————————————————–Verbose mode can be enabled via `-v, –verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (4.2.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
– framework-arduinoespressif32 @ 3.20002.220503 (2.0.2)
– tool-esptoolpy @ 1.30300.0 (3.3.0)
– toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 33 compatible libraries
Scanning dependencies…
Dependency Graph
|– ESP Async WebServer @ 1.2.3
| |– AsyncTCP @ 1.1.1
| |– FS @ 2.0.0
| |– WiFi @ 2.0.0
|– SPIFFS @ 2.0.0
| |– FS @ 2.0.0
|– AsyncTCP @ 1.1.1
|– WiFi @ 2.0.0
Building in release mode
Linking .pio\build\esp32dev\firmware.elf
c:/users/pauls/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib08d\libESP Async WebServer.a(AsyncWebSocket.cpp.o):(.literal._ZN22AsyncWebSocketResponseC2ERK6StringP14AsyncWebSocket+0x10): undefined reference to `SHA1Init’
c:/users/pauls/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib08d\libESP Async WebServer.a(AsyncWebSocket.cpp.o):(.literal._ZN22AsyncWebSocketResponseC2ERK6StringP14AsyncWebSocket+0x18): undefined reference to `SHA1Update’
c:/users/pauls/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib08d\libESP Async WebServer.a(AsyncWebSocket.cpp.o):(.literal._ZN22AsyncWebSocketResponseC2ERK6StringP14AsyncWebSocket+0x1c): undefined reference to `SHA1Final’
c:/users/pauls/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib08d\libESP Async WebServer.a(AsyncWebSocket.cpp.o): in function `AsyncWebSocketResponse::AsyncWebSocketResponse(String const&, AsyncWebSocket*)’:
C:\Users\pauls\Documents\PlatformIO\Projects\2_3_Control_Outputs/.pio/libdeps/esp32dev/ESP Async WebServer/src/AsyncWebSocket.cpp:1269: undefined reference to `SHA1Init’
c:/users/pauls/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\pauls\Documents\PlatformIO\Projects\2_3_Control_Outputs/.pio/libdeps/esp32dev/ESP Async WebServer/src/AsyncWebSocket.cpp:1270: undefined reference to `SHA1Update’
c:/users/pauls/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\pauls\Documents\PlatformIO\Projects\2_3_Control_Outputs/.pio/libdeps/esp32dev/ESP Async WebServer/src/AsyncWebSocket.cpp:1271: undefined reference to `SHA1Final’
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32dev\firmware.elf] Error 1
=========================================== [FAILED] Took 25.80 seconds ===========================================
The terminal process “C:\Users\pauls\.platformio\penv\Scripts\platformio.exe ‘run’, ‘–environment’, ‘esp32dev'” terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
*******************************************************************************
Basically, I am getting an undefined reference error in the file AsyncWebSocket.cpp for SHA1Init, SHA1Update and SHA1Final. Usually, I am pretty good at resolving errors like these, but I’m not having any luck. Any suggestions, please?
Paul

Question Tags: undefined reference
4 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
I have no idea what might be causing the issue.
But, after reading this: https://github.com/me-no-dev/ESPAsyncWebServer/issues/1151
I think it has to do with the newest ESP32 boards version. 
There are some solutions presented in that discussion. Check them out and see if you can solve the issue.
Regards,
Sara

0 Vote Up Vote Down
Paul Sanders answered 3 years ago

Thanks, Sara. I will will check this out.
Paul

0 Vote Up Vote Down
Paul Sanders answered 3 years ago

I just changed 

platform = espressif32

 
to 
 

platform = espressif32 @ ~3.5.0
 

in my platformio.ini and I just had a successful build.  It will take me a little while to check out the code execution, but so far — success!!

 
Thanks for finding this Sara.  I am now closer to giving my daughters web pages to control their RGB lights.
-Paul

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Great!
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.