ESP32 使用powershell搭建好了环境,执行build编译helloworld例程,报ninja错误

jaffer
Posts: 5
Joined: Mon Feb 27, 2023 11:16 am

ESP32 使用powershell搭建好了环境,执行build编译helloworld例程,报ninja错误

Postby jaffer » Sun Mar 26, 2023 3:23 pm

我在windows11上刚配置完esp32编译环境(使用powershell方案),之后进行测试发现编译helloworld例程时报ninja错误;

我的编译环境配置是这样的:
1. git clone esp-idf project
2. git checkout v5.0.1
3. 打开powershell,运行./install.bat
4. 运行 ./export.ps1 导入环境变量
5. 进入helloworld例程目录 相对路径为“esp-idf\examples\get-started\hello_world”
6. 运行 idf.py build之后ninja报错,报错信息如下:

Code: Select all

Executing action: all (aliases: build)
Running ninja in directory e:\esp-idf\esp-idf\examples\get-started\hello_world\build
Executing "ninja all"...
ninja: error: 'E:/esp-idf/esp-idf/components/esp_wifi/lib/esp32/libcoexist.a', needed by 'hello_world.elf', missing and no known rule to make it
ninja failed with exit code 1, output of the command is in the e:\esp-idf\esp-idf\examples\get-started\hello_world\build\log\idf_py_stderr_output_7424 and e:\esp-idf\esp-idf\examples\get-started\hello_world\build\log\idf_py_stdout_output_7424
PS E:\esp-idf\esp-idf\examples\get-started\hello_world> idf.py build
Executing action: all (aliases: build)
Running ninja in directory e:\esp-idf\esp-idf\examples\get-started\hello_world\build
Executing "ninja all"...
ninja: error: 'E:/esp-idf/esp-idf/components/esp_wifi/lib/esp32/libcoexist.a', needed by 'hello_world.elf', missing and no known rule to make it
ninja failed with exit code 1, output of the command is in the e:\esp-idf\esp-idf\examples\get-started\hello_world\build\log\idf_py_stderr_output_25140 and e:\esp-idf\esp-idf\examples\get-started\hello_world\build\log\idf_py_stdout_output_25140
难道在windows上通过powershell命令配置环境,之后会编译不支持吗?这不应该呀

ESP-Kevin
Posts: 9
Joined: Fri Jul 01, 2022 6:10 am

Re: ESP32 使用powershell搭建好了环境,执行build编译helloworld例程,报ninja错误

Postby ESP-Kevin » Mon Mar 27, 2023 11:26 am

试试在git checkout v5.0.1之后加上git submodule update再install

jaffer
Posts: 5
Joined: Mon Feb 27, 2023 11:16 am

Re: ESP32 使用powershell搭建好了环境,执行build编译helloworld例程,报ninja错误

Postby jaffer » Mon Mar 27, 2023 4:11 pm

感谢您的回复

我切换到v5.0.1分支之后没有运行git status检查分区是否干净,遗漏了子模块未同步导致,我重新运行 git submodule update --init --recursive 后解决了

关于环境的完整细节,我整理为了一份博客分享,欢迎其他有需要的人查阅参考
https://blog.csdn.net/weixin_44821644/a ... /107893487

Who is online

Users browsing this forum: No registered users and 79 guests