Spritetm / libesphttpd

NOTE: THIS CODE IS UNMAINTAINED. Please take a look at https://github.com/chmorgan/libesphttpd instead.
125 stars 109 forks source link

Issue compiling with sdk ssl lib #25

Closed ToSa27 closed 8 years ago

ToSa27 commented 8 years ago

Using the library as part of a project that requires the ssl library from the sdk fails. Compilation works fine but linking fails with the following error message:

C:/Espressif/ESP8266_SDK/lib\libssl.a(ssl_crypto_misc.o): In function base64_decode': (.irom0.text+0x120): multiple definition ofbase64_decode' libesphttpd\libesphttpd.a(base64.o):c:\Users..........\libesphttpd/core/base64.c:45: first defined here collect2.exe: error: ld returned 1 exit status

As an interim fix I added the following to the makefile: ifeq ("$(USE_SSL_LIB)","yes") CFLAGS += -DUSE_SSL_LIB endif

and then surrounded the entire content of base64.c with

ifndef USE_SSL_LIB

.....

endif

No idea if there is a more elegant way to detect this. Changing the name of the functions would be an option but would likely waste precious space having code for the same purpose twice in the firmware.

ToSa27 commented 8 years ago

Fixed in https://github.com/Spritetm/libesphttpd/commit/e7e6f203000324e126295ffa4d99e478a0e15605