Hey,
I’m trying to use the openssl library for SHA256 encryption within my platformio project. Including the header files by using the “build_flags” option in the platformio.ini file worked fine (“-I/usr/local/include”) and the project compiles without any errors. But I’m facing the following error when linking all the files:
src/senddata.cpp:99: undefined reference to 'SHA256'
.
I tried adding linkflags “-L/usr/local/lib -lcrypto” as described in the openssl doc, but it did not do anything.
I also tried adding the path of the entire openssl library to “lib_deps” in platformio.ini, but this just caused more errors.
Does anybody know a similar problem and can help me finding a solution for this?
Thanks a lot in advice.
Paddlix
Some information:
openssl installed as described in the openssl doc.
IDE: VSCode
OS: macOS 13.4.1
Complete Error
Linking .pio/build/usb/firmware_ttgov21new_v3.6.1.elf
/Users/../.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch5/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/usb/src/senddata.cpp.o:(.literal._Z8sendDatav+0x4): undefined reference to 'SHA256'
/Users/../.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch5/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/usb/src/senddata.cpp.o: in function 'sendData()':
/Users/../Library/Mobile Documents/com~apple~CloudDocs/Documents/../ESP32-Paxcounter-master/src/senddata.cpp:99: undefined reference to 'SHA256'
collect2: error: ld returned 1 exit status
*** [.pio/build/usb/firmware_ttgov21new_v3.6.1.elf] Error 1