Closed
Description
The compilation of a project referencing MD5Builder fails link with undefined reference to `MD5Update'
Creating a minimal project with this error:
-
Latest ESP-IDF, install.sh and export.sh
-
Create new project using
idf.py create-project proj1 cd proj1
At this point the project compiles.
-
Add arduino-esp32 as in the docs
mkdir -p components && \ cd components && \ git clone https://github.com/espressif/arduino-esp32.git arduino && \ cd arduino && \ git submodule update --init --recursive && \ cd ../.. && \ idf.py menuconfig
-
Rename 'proj1.c' to 'proj1.cpp' and change in 'CMakeList.txt', content from docs. At this point the project still compiles
-
Add reference to 'MD5Builder.h' like so: (based on the example in the docs)
//file: proj1.cpp #include "Arduino.h" #include "MD5Builder.h" void setup(){ Serial.begin(115200); MD5Builder hasher; hasher.add("hello"); Serial.println( hasher.toString()); } void loop(){ Serial.println("loop"); delay(1000); } extern "C" { void app_main(void) { setup(); while(1) loop(); } }
Now the compilation fails with linker error:
../components/arduino/cores/esp32/MD5Builder.cpp:37: undefined reference to `MD5Update'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
Please advise.
Metadata
Metadata
Assignees
Labels
No labels