Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: implicit declaration of function 'esp_tls_conn_delete' (CA-319) #138

Open
anoopkumares opened this issue Nov 2, 2023 · 3 comments

Comments

@anoopkumares
Copy link

anoopkumares commented Nov 2, 2023

I am trying to compile iothub_client_sample_mqtt example. I have cloned esp-idf repo and this repo. but while building the code (idf.py build), I am getting the following error:

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);

How can I fix this error ?

@github-actions github-actions bot changed the title error: implicit declaration of function 'esp_tls_conn_delete' error: implicit declaration of function 'esp_tls_conn_delete' (CA-319) Nov 2, 2023
@aleblsv
Copy link

aleblsv commented Nov 6, 2023

@anoopkumares
This is because you compile with esp-idf v5
Change from esp_tls_conn_delete to esp_tls_conn_destroy

@anoopkumares
Copy link
Author

I fixed that. But I am getting another error.
tlsio_esp_tls.c:219:59: error: invalid application of 'sizeof' to incomplete type 'esp_tls_t' {aka 'struct esp_tls'} 219 | result->esp_tls_handle = calloc(1, sizeof(esp_tls_t)); | ^~~~~~~~~ [14/84] Building C object esp-idf/port...iot-sdk-c/c-utility/src/sastoken.c.obj ninja: build stopped: subcommand failed.

@aleblsv
Copy link

aleblsv commented Nov 7, 2023

@anoopkumares
Just try to allocate fixed memory, in my case seems that 2*1024 works as expected.

            // result->esp_tls_handle = (esp_tls_t*)calloc(1, sizeof(esp_tls_t));
            //ToDo: esp-idf v5.1.1 compilation problem of un-complete type sizeof(esp_tls_t), below is a workaround
            result->esp_tls_handle = (esp_tls_t*)calloc(1, 2*1024);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants