BTW, thanks for creating the curl build instructions. I followed the instructions at esp32-snippets/curl/build_files/. Unfortunately when I make the project, I get the following error:
CC lib/vauth/cleartext.o
/Users/mike/Dev/esp/i2s/components/curl/lib/vauth/cleartext.c:165:1: fatal error: opening dependency file lib/vauth/cleartext.d: No such file or directory
}
^
compilation terminated.
make[1]: * [lib/vauth/cleartext.o] Error 1
make: * [curl-build] Error 2
Hi my friend ... looking at it now. If you can, ping me at #ESP32 on IRC channel that would be great and we can chat live. Failing that run "ls -l /Users/mike/Dev/esp/i2s/components" and attach the results in a ZIP to this issue.
nkolban - Thanks for your help today!
Here's some notes captured for "Getting the ESP32 curl build working if you're developing on MacOS/OSX":
without the -DMBEDTLS_FS_IO flag, you'll get various errors in mbedtls.c like:
error: implicit declaration of function 'mbedtls_x509_crt_parse_file' [-Werror=implicit-function-declaration]
ret = mbedtls_x509_crt_parse_file(&connssl->cacert, ssl_cafile);
Oops, hadn't actually included curl yet. Now that I've added "#include
/Users/jeff/Dev/esp/i2s/build/curl/libcurl.a(mbedtls.o):(.literal.mbed_connect_common+0x8c): undefined reference to mbedtls_x509_crt_parse_file'
/Users/jeff/Dev/esp/i2s/build/curl/libcurl.a(mbedtls.o):(.literal.mbed_connect_common+0x90): undefined reference tombedtls_x509_crt_parse_path'
/Users/jeff/Dev/esp/i2s/build/curl/libcurl.a(mbedtls.o):(.literal.mbed_connect_common+0x94): undefined reference to mbedtls_pk_parse_keyfile'
/Users/jeff/Dev/esp/i2s/build/curl/libcurl.a(mbedtls.o):(.literal.mbed_connect_common+0x98): undefined reference tombedtls_x509_crl_parse_file'
/Users/jeff/Dev/esp/i2s/build/curl/libcurl.a(mbedtls.o): In function mbed_connect_step1':
/Users/jeff/Dev/esp/i2s/components/curl/lib/vtls/mbedtls.c:996: undefined reference tombedtls_x509_crt_parse_file'
/Users/jeff/Dev/esp/i2s/components/curl/lib/vtls/mbedtls.c:996: undefined reference to mbedtls_x509_crt_parse_path'
/Users/jeff/Dev/esp/i2s/components/curl/lib/vtls/mbedtls.c:996: undefined reference tombedtls_x509_crt_parse_file'
/Users/jeff/Dev/esp/i2s/components/curl/lib/vtls/mbedtls.c:996: undefined reference to mbedtls_pk_parse_keyfile'
/Users/jeff/Dev/esp/i2s/components/curl/lib/vtls/mbedtls.c:996: undefined reference tombedtls_x509_crl_parse_file'
Find me on #ESP32 ... we'll go for round 2 :-)
I have a new guess ... are you using the VERY latest ESP-IDF distribution ... see the following which was added in March 2017. This would be consistent with the problems described ...
https://github.com/espressif/esp-idf/commit/74817c35f3826939337f911263b210f9b7a60efe
If your ESP-IDF is back-level to this ... this would be the problem and the solution would be to use the latest ESP-IDF.
That seems to be it! I'm putting together a small test to see if it all works...
If it works, the recipe in this thread needs to be changed to remove -DMBEDTLS_FS_IO which is now the default.
Yes, seems to work well. Tested it with your testCurl.c code (modified to use example.com instead of the raspberrypi:) successfully returned "
CFLAGS+=-DHAVE_CONFIG_H -DBUILDING_LIBCURLAwesome, thanks again - don't know how you do it!
i have a similar question,
i get an compilation error during the first build caused by error: unknown type name 'curl_off_t'.
do you know where this came from?
The curl_off_t issue has been tracked down and resolved in this issue:
closing with completion. Don't hesitate to re-open as needed.
Most helpful comment
nkolban - Thanks for your help today!
Here's some notes captured for "Getting the ESP32 curl build working if you're developing on MacOS/OSX":
> mkdir build/curl/lib/vauth
> mkdir build/curl/lib/vtls
> CFLAGS+=-DHAVE_CONFIG_H -DBUILDING_LIBCURL -DMBEDTLS_FS_IO
without the -DMBEDTLS_FS_IO flag, you'll get various errors in mbedtls.c like: