Page 1 of 1

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

Posted: Wed Aug 17, 2022 12:17 pm
by alhadi
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?

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

Posted: Tue Aug 23, 2022 9:38 am
by ESP_Mahavir
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?

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

Posted: Tue Aug 23, 2022 11:07 am
by alhadi
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?

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

Posted: Wed Aug 24, 2022 3:50 am
by ESP_Mahavir
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.

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

Posted: Sun Aug 28, 2022 8:22 am
by alhadi
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

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

Posted: Sat Sep 10, 2022 6:51 am
by xryl669
In fact, esp_config.h includes mbedtls_config.h that doesn't exist either, so it doesn't solve the issue.

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

Posted: Mon Sep 19, 2022 10:24 pm
by bkgoodman
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??

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

Posted: Wed Sep 21, 2022 12:41 pm
by bkgoodman
Bumping this ... because several projects are stuck on this. Any idea?