繁体   English   中英

当esp32出现在newlib /而非esp32 /中的组件#includes esp_types.h时,esp-idf build flash失败

[英]esp-idf build flash fails when esp32 when component #includes esp_types.h found in newlib/ not esp32/

在Mac osX上,我遵循了入门指南 ,并且无法在hello_world示例项目中通过make flash

我正在使用的所有代码都是直接从此仓库中克隆的: https : //github.com/espressif/esp-idf

我执行make clean (工作),并make flash从我的程序hello_world例子拷贝~/esp/hello_world/ ,使闪光灯给出了这个致命的错误:

In file included from /Users/me/esp/esp-idf/components/esp_rom/include/esp32/rom/uart.h:18:0,
  from /Users/me/esp/esp-idf/components/bootloader_support/src/bootloader_clock.c:14:
/Users/me/esp/esp-idf/components/esp_common/include/esp_types.h:19:23:fatal error: sys/cdefs.h: No such file or directory
compilation terminated.

esp-idf/components/esp_common/include/esp_types.h是: #include <sys/cdefs.h>

里面有一个文件

.../esp-idf/components/newlib/include/sys/cdefs.h但不在.../esp-idf/components/esp32/include/sys/cdefs.h

我已经通过创建软链接将其确认为问题:

cd ~/esp/esp-idf/components/esp32/include
ln -s ~/esp/esp-idf/components/newlib/include/sys sys

之后,构建将继续进行下一个类似的问题

esp32/include/sys/cdefs.h:43:36: fatal error: machine/_default_types.h: No such file or directory

我研究了几种将newlib / include目录添加到要搜索#include指令的系统目录列表中的选项,包括在命令行中添加-I选项,但是我无法确定“正确”的方法它,因为我不想修改存储库https://github.com/espressif/esp-idf中的任何文件

我希望这是显而易见的。 自从我在Uni以来,我就没有处理过make文件,我觉得我可能不得不使用long int来存储多少年前。

您链接到的入门指南版本指示您使用名为idf.py的Python脚本来配置,构建和刷新esp32项目(在完成安装框架和支持工具的其他几个步骤之后)。 该指南在任何地方都没有直接描述运行make ,尽管看起来可能与早期版本有所不同。

尽管似乎还有其他选择,但是最直接的方法是遵循指南并使用描述的idf.py脚本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM