mlesniew / PicoWebsocket

GNU Lesser General Public License v2.1
0 stars 1 forks source link

espressif32 @6.5.0: mbedtls_sha1() fails to compile #2

Open mhaberler opened 3 weeks ago

mhaberler commented 3 weeks ago

I need to step back in espressif32 versions to isolate an i2c bug

[env]
platform = espressif32 @6.5.0
framework = arduino

then I get

In file included from lib/PicoWebsocket/src/PicoWebsocket.cpp:7:
/Users/mah/.platformio/packages/framework-arduinoespressif32@3.20014.231204/tools/sdk/esp32s3/include/mbedtls/mbedtls/include/mbedtls/sha1.h:323:25: error: conflicting declaration of C function 'void mbedtls_sha1(const unsigned char*, size_t, unsigned char*)'
 MBEDTLS_DEPRECATED void mbedtls_sha1(const unsigned char *input,
                         ^~~~~~~~~~~~
<command-line>: note: previous declaration 'int mbedtls_sha1(const unsigned char*, size_t, unsigned char*)'
/Users/mah/.platformio/packages/framework-arduinoespressif32@3.20014.231204/tools/sdk/esp32s3/include/mbedtls/mbedtls/include/mbedtls/sha1.h:291:5: note: in expansion of macro 'mbedtls_sha1_ret'
 int mbedtls_sha1_ret(const unsigned char *input,
     ^~~~~~~~~~~~~~~~
lib/PicoWebsocket/src/PicoWebsocket.cpp: In function 'void {anonymous}::sha1(const String&, uint8_t*)':
lib/PicoWebsocket/src/PicoWebsocket.cpp:25:79: error: call of overloaded 'mbedtls_sha1(const unsigned char*, unsigned int, uint8_t*&)' is ambiguous
     mbedtls_sha1_ret((const unsigned char *) text.c_str(), text.length(), hash);
                                                                               ^
<command-line>: note: candidate: 'int mbedtls_sha1(const unsigned char*, size_t, unsigned char*)'
/Users/mah/.platformio/packages/framework-arduinoespressif32@3.20014.231204/tools/sdk/esp32s3/include/mbedtls/mbedtls/include/mbedtls/sha1.h:291:5: note: in expansion of macro 'mbedtls_sha1_ret'
 int mbedtls_sha1_ret(const unsigned char *input,
     ^~~~~~~~~~~~~~~~
In file included from lib/PicoWebsocket/src/PicoWebsocket.cpp:7:
/Users/mah/.platformio/packages/framework-arduinoespressif32@3.20014.231204/tools/sdk/esp32s3/include/mbedtls/mbedtls/include/mbedtls/sha1.h:323:25: note: candidate: 'void mbedtls_sha1(const unsigned char*, size_t, unsigned char*)'
 MBEDTLS_DEPRECATED void mbedtls_sha1(const unsigned char *input,

what would you suggest? maybe bring in https://github.com/esp8266/Arduino/tree/master/libraries/Hash ?

thanks, Michael

edit: might be the old compiler version, looks like c++11 rather than c++17

mlesniew commented 3 weeks ago

Sorry, I can't reproduce this.

I tried building the PicoMQTT websocket_server example for the esp32 pinning the platform version (espressif32 @6.5.0). It compiles fine...

mhaberler commented 3 weeks ago

I'll post an example to reproduce, this is too convoluted

same issue: https://github.com/espressif/arduino-esp32/issues/6691