如何修复 ESP-IDF fatal error: esp_crt_bundle.h: No such file or directory
问题
编译 ESP-IDF 项目时,你收到如下错误消息:
esp_crt_bundle_error.txt
/home/user/my-project/managed_components/espressif__rmaker_common/src/esp-mqtt/esp-mqtt-glue.c:47:10: fatal error: esp_crt_bundle.h: No such file or directory
47 | #include <esp_crt_bundle.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.解决方案
让 Rainermaker 不使用证书包,或者在项目的 sdkconfig 文件中启用证书包组件。
让 Rainmaker 不使用证书包(推荐)
在项目的 sdkconfig 文件中,设置以下内容:
sdkconfig_disable_cert_bundle.txt
CONFIG_ESP_RMAKER_USE_CERT_BUNDLE=n
CONFIG_ESP_RMAKER_MQTT_USE_CERT_BUNDLE=n启用证书包组件
这会占用大量 flash 空间,所以我的建议是只在真正需要时才这样做。
在项目的 sdkconfig 文件中启用证书包组件:
sdkconfig_enable_cert_bundle.txt
CONFIG_ESP_CRT_BUNDLE=yCheck out similar posts by category:
ESP-IDF
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow