espressif/esp-azure

tls error when compiling on esp-idf 5 (CA-295)

Opened this issue · 4 comments

I was tying to compile the sample application iothub_client_sample_mqtt with esp-idf 5.0.0 and is getting the below errors. Has anybody come across them?

esp5/esp-idf/esp-azure/port/src/tlsio_esp_tls.c:127:5: error: implicit declaration of function 'esp_tls_conn_delete'; did you mean 'esp_tls_conn_write'? [-Werror=implicit-function-declaration]
  127 |     esp_tls_conn_delete(tls_io_instance->esp_tls_handle);
      |     ^~~~~~~~~~~~~~~~~~~
      |     esp_tls_conn_write
/esp5/esp-idf/esp-azure/port/src/tlsio_esp_tls.c: In function 'tlsio_esp_tls_create':
/Users/preveen/esp5/esp-idf/esp-azure/port/src/tlsio_esp_tls.c:219:59: error: invalid application of 'sizeo' to incomplete type 'esp_tls_t' {aka 'struct esp_tls'}
  219 |                 result->esp_tls_handle = calloc(1, sizeof(esp_tls_t));
      |                                                           ^~~~~~~~~

Yes I too came accross this issue. Can anyone help me to solve this issue?

Hi There are no the "esp_tls_conn_delete()" functions in the v5.0 IDF SDK. Please refer to the “Function Deprecations And Recommended Alternatives” programming guide.
image

second issue still didn't resolve

/home/ubuntu22/esp/esp-azure/port/src/tlsio_esp_tls.c:220:59: error: invalid application of 'sizeof' to incomplete type 'esp_tls_t' {aka 'struct esp_tls'}
220 | result->esp_tls_handle = calloc(1, sizeof(esp_tls_t));
|

To anyone having this issue, the second error can be resolved by replacing the line:
result->esp_tls_handle = calloc(1, sizeof(esp_tls_t));
with:
result->esp_tls_handle = esp_tls_init();