Error: fatal error: mbedtls/config.h: No such file or directory

alhadi
Posts: 15
Joined: Thu Apr 14, 2022 9:29 am

Error: fatal error: mbedtls/config.h: No such file or directory

Postby alhadi » Wed Aug 17, 2022 12:17 pm

Hello,

I migrated my project to VS code
I cloned my project from GitHub and when I compile, I get this error:
c:\espressif\frameworks\esp-idf-v4.4.2\components\mbedtls\mbedtls\include\mbedtls\base64.h:26:10: fatal error: mbedtls/config.h: No such file or directory
Knowing that the project was working before I migrated to VS code
The version is v4.4.2
I have 2 projects migrated. One of them is working fine. The other one is like this
What is the problem?

ESP_Mahavir
Posts: 188
Joined: Wed Jan 24, 2018 6:51 am

Re: Error: fatal error: mbedtls/config.h: No such file or directory

Postby ESP_Mahavir » Tue Aug 23, 2022 9:38 am

This build error should not occur, as we use `esp_config.h` header file for configuration.

Please see https://github.com/espressif/esp-idf/bl ... s.txt#L189

Can you please check your build command once and confirm above mentioned `-DMBEDTLS_CONFIG_FILE` CFLAG in it?

alhadi
Posts: 15
Joined: Thu Apr 14, 2022 9:29 am

Re: Error: fatal error: mbedtls/config.h: No such file or directory

Postby alhadi » Tue Aug 23, 2022 11:07 am

ESP_Mahavir wrote:
Tue Aug 23, 2022 9:38 am
This build error should not occur, as we use `esp_config.h` header file for configuration.

Please see https://github.com/espressif/esp-idf/bl ... s.txt#L189

Can you please check your build command once and confirm above mentioned `-DMBEDTLS_CONFIG_FILE` CFLAG in it?
Thank you for your reply
How do I check my build command?

ESP_Mahavir
Posts: 188
Joined: Wed Jan 24, 2018 6:51 am

Re: Error: fatal error: mbedtls/config.h: No such file or directory

Postby ESP_Mahavir » Wed Aug 24, 2022 3:50 am

Please have a look at `build/compile_commands.json` file in your project directory.

Alternatively you may run `idf.py -v build` for more verbose build.

alhadi
Posts: 15
Joined: Thu Apr 14, 2022 9:29 am

Re: Error: fatal error: mbedtls/config.h: No such file or directory

Postby alhadi » Sun Aug 28, 2022 8:22 am

ESP_Mahavir wrote:
Wed Aug 24, 2022 3:50 am
Please have a look at `build/compile_commands.json` file in your project directory.

Alternatively you may run `idf.py -v build` for more verbose build.
Thank you for your reply

I found the problem
The file base64.h was included in one of my C files
I don't know how that happened or why it wasn't giving errors before
Anyway, I removed that #include line and the project builds successfully now

xryl669
Posts: 5
Joined: Tue Oct 09, 2018 4:31 pm

Re: Error: fatal error: mbedtls/config.h: No such file or directory

Postby xryl669 » Sat Sep 10, 2022 6:51 am

In fact, esp_config.h includes mbedtls_config.h that doesn't exist either, so it doesn't solve the issue.

bkgoodman
Posts: 45
Joined: Fri Feb 17, 2017 12:41 pm

Re: Error: fatal error: mbedtls/config.h: No such file or directory

Postby bkgoodman » Mon Sep 19, 2022 10:24 pm

I am having this exact problem - and it is also trying to migrate 4.1 code to 4.2.2

I did what you said here - and there are MANY references to:

Code: Select all

-DMBEDTLS_CONFIG_FILE=\\\"mbedtls/esp_config.h\\\
in the

Code: Select all

compile_commands.json
file.

There are are a few contentenders to what this could be in my esp-idf directory:

Code: Select all

./components/mbedtls/mbedtls/include/mbedtls/mbedtls_config.h
./components/openthread/openthread/third_party/mbedtls/mbedtls-config.h
./components/openthread/openthread/third_party/mbedtls/repo/include/mbedtls/config.h
I figured a idf.py reconfigure or a fullclean command might fix this - but it didn't

So - how do I fix??

bkgoodman
Posts: 45
Joined: Fri Feb 17, 2017 12:41 pm

Re: Error: fatal error: mbedtls/config.h: No such file or directory

Postby bkgoodman » Wed Sep 21, 2022 12:41 pm

Bumping this ... because several projects are stuck on this. Any idea?

Who is online

Users browsing this forum: No registered users and 106 guests