kpn-iot / thingsml-c-library

C library for ThingsML on your device
https://kpn-iot.github.io/thingsml-c-library/
MIT License
6 stars 4 forks source link

'base64' has not been declared #20

Closed patvdleer closed 2 years ago

patvdleer commented 2 years ago

.pio/libdeps/esp-wrover-kit/ThingsML/src/senml/senml_helpers.cpp:107:22: error: 'base64' has not been declared

name followed by '::' must be a class or namespace nameC/C++(276)

int printBinaryAsBase64(const unsigned char *data, unsigned int length) {
#ifdef ESP32
    String encoded = base64::encode((uint8_t *)data, length);
    return printText(encoded.c_str(), encoded.length());
patvdleer commented 2 years ago

I commented it out and simply returned 1 to see if it would compile;

.pio/build/esp-wrover-kit/lib521/libThingsML.a(senml_float_record.cpp.o): In function `base64_dec_len(char*, int)':

/home/patrick/Documents/PlatformIO/Projects/car_tracker/.pio/libdeps/esp-wrover-kit/ThingsML/src/senml/record/../../util/base64.h:9: multiple definition of `base64_dec_len(char*, int)'

.pio/build/esp-wrover-kit/src/main.cpp.o:/home/patrick/Documents/PlatformIO/Projects/car_tracker/.pio/libdeps/esp-wrover-kit/ThingsML/src/senml/../util/base64.h:9: first defined here

for some reason the compiler doesn't seem to resolve the paths; see src/record/../../util/base64.h and src/senml/../util/base64.h

patvdleer commented 2 years ago

@josephverburg please read the commit message and keep in mind I'm not native in C

josephverburg commented 2 years ago

There was a custom base64 implementation for ESP32 that did not work with al versions of the ESP32 Arduino Library, this has been removed and now the built in base64 will be used.