您尚未登录。

楼主 #1 2018-05-03 16:40:19

mkseven32
会员
注册时间: 2018-04-24
已发帖子: 57
积分: 57

如何 使用eclipse 搭建esp32 开发环境?

参考 https://whycan.cn/t_141.html  和http://esp-idf.readthedocs.io/en/latest/get-started/eclipse-setup.html

一步步 按照来做, 还是无法编译~~~~

请各位帮忙看一下配置,具体哪里设置错了??

ESP32 开发包位置====>>>

1. esp-adf located in :F:\Embedded\esp-adf
2. esp-idf located in :F:\Embedded\esp-adf\esp-idf
3. msys32 toolchain located in :F:\msys32

Eclipse 设置 ====>>>

1. import project exiting code location: F:\Embedded\esp-adf\examples\player\pipeline_bt_sink

2. Toolchain editor :Cygwin GCC
     1.png

3. C/C++ Build->Environment :
     ADF_PATH ==== F://Embedded//esp-adf
     IDF_PATH ==== F://Embedded//esp-adf//esp-idf
     PATH ==== F:\msys32\usr\bin;F:\msys32\mingw32\bin;F:\msys32\opt\xtensa-esp32-elf\bin;
     BATCH_BUILD ==== 1
     3_20180503-0434.png
     
4. C/C++ Build->Builder Settings :
     Build command: python ${IDF_PATH}/tools/windows/eclipse_make.py

5. C/C++ General -> Preprocessor Include Paths, Macros, etc. :设置参考下图
     3_20180503-0434.png

     4.png

     6.png

build project 执行 的结果 还是依然 是 显示没有对应的rule

15:33:08 **** Incremental Build of configuration Default for project pipeline_bt_sink ****
make all 
make: *** No rule to make target 'all'.  Stop.

15:33:08 Build Failed. 1 errors, 0 warnings. (took 752ms)

另外 还有一个问题,头文件和路径都添加了, 但是还是 出现 Symbol 'CONFIG_LOG_DEFAULT_LEVEL' could not be resolved,  的错误~~~
即便 添加了build\include\

离线

#2 2018-05-03 17:36:43

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,223
积分: 9197

Re: 如何 使用eclipse 搭建esp32 开发环境?

QQ20180503173428.png
这就尴尬了, 貌似我的没有问题.





离线

#3 2018-05-03 18:42:43

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,223
积分: 9197

Re: 如何 使用eclipse 搭建esp32 开发环境?

https://stackoverflow.com/questions/24198380/error-program-make-not-found-in-path-when-i-try-to-build-c-project-in-eclipse

Create a copy of the mingw32-make exe. Rename mingw32-make to make. Include the path to the executable in PATH variable. Solved my issue.

这个问题和 make.exe 的搜素路径有关系.
你用 everything 把 电脑里面所有的 不是 mingw32 里面的make.exe 重命名试一试。





离线

楼主 #4 2018-05-04 09:50:40

mkseven32
会员
注册时间: 2018-04-24
已发帖子: 57
积分: 57

Re: 如何 使用eclipse 搭建esp32 开发环境?

晕哥 说:

https://stackoverflow.com/questions/24198380/error-program-make-not-found-in-path-when-i-try-to-build-c-project-in-eclipse

Create a copy of the mingw32-make exe. Rename mingw32-make to make. Include the path to the executable in PATH variable. Solved my issue.

这个问题和 make.exe 的搜素路径有关系.
你用 everything 把 电脑里面所有的 不是 mingw32 里面的make.exe 重命名试一试。


所有的 不是 ????    mingw32 ???  是指msys32 文件下的mingw32的文件夹 吗 ,可是那里面没有make.exe 啊 》?》

这是搜索出来的结果,在C盘有几个make  但是这些我都没有添加 进eclipse 的路径下。
make.png

您那边的环境 下 只有 工具链 下一个make.exe  吗?

离线

#5 2018-05-04 09:56:54

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,223
积分: 9197

Re: 如何 使用eclipse 搭建esp32 开发环境?

虽然你没手动添加, 但是有可能存在系统的环境变量里面。





离线

楼主 #6 2018-05-04 10:15:03

mkseven32
会员
注册时间: 2018-04-24
已发帖子: 57
积分: 57

Re: 如何 使用eclipse 搭建esp32 开发环境?

晕哥 说:

虽然你没手动添加, 但是有可能存在系统的环境变量里面。

C 盘 D 盘,E 盘的都改成 make-d了。 但编译后还是出错


10:10:58 **** Build of configuration Default for project pipeline_bt_sink ****
python F://Embedded//esp-adf//esp-idf/tools/windows/eclipse_make.py flash 
make: *** No rule to make target 'flash'.  Stop.
Running make in 'F:/Embedded/esp-adf/examples/player/pipeline_bt_sink/main'

10:10:58 Build Failed. 1 errors, 0 warnings. (took 402ms)

离线

#7 2018-05-04 10:16:47

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,223
积分: 9197

Re: 如何 使用eclipse 搭建esp32 开发环境?

Create a copy of the mingw32-make exe. Rename mingw32-make to make.

按上面办法,再不行换一台干净点的电脑再测试吧。





离线

楼主 #8 2018-05-04 13:46:52

mkseven32
会员
注册时间: 2018-04-24
已发帖子: 57
积分: 57

Re: 如何 使用eclipse 搭建esp32 开发环境?

晕哥 说:

Create a copy of the mingw32-make exe. Rename mingw32-make to make.

按上面办法,再不行换一台干净点的电脑再测试吧。

就差 换电脑了!!! 不过最后还是让我折腾出来了!!!

总结几点如下 :

1.  之前安装过visual studio 和 visual GDB ,想使用这样的IDE 组合来开发, 造成电脑里面其他地方也有make.exe 存在, 但是eclipse 的PATH 里面绝对没有添加这些路径进去, 晕哥说让我将其他make.exe 改名, 改了之后也不行, 我甚至将 visual studio  和visual GDB 都删 了, 但是编译依然出错...
     这就证明了 eclipse 的PATH 如果没有设置,build 时是不会去找这些其他的make.exe 的

2. 重新 一步步 新建工程, 在 第一步import -> exiting code location 的 地方 换了个方式, 选择 esp-adf (如果你开发的esp-idf ,相应的换esp-idf)的源代码路径,这个和get-started guide 中的说明 貌似是相驳的 ,如下所示,

另外其他设置还是和之前的配置一样(具体参考get-started guide  Eclipse IDE on Windows

     

Import New Project
...
•Once Eclipse is running, choose File -> Import…
•In the dialog that pops up, choose “C/C++” -> “Existing Code as Makefile Project” and click Next.
•On the next page, enter “Existing Code Location” to be the directory of your IDF project. Don’t specify the path to the ESP-IDF directory itself (that comes later). The directory you specify should contain a file named “Makefile” (the project Makefile).
...

这段描述 我一直很奇怪 ,到底是选择那个作为exiting code location呢? 这次选择最顶层 esp-adf , 居然编译的时候 就可以了~~~
之前是选择到esp-adf 具体的某个example 为exiting code location, 当时也是考虑在example 目录下是有make 文件的,按道理是可以调用起来~~但就是死活不行~~~~

3.  get-started Guide 中 还有一点关于C/C++ build 配置
   

Project Properties

•The new project will appear under Project Explorer. Right-click the project and choose Properties from the context menu.


•Click on the “C/C++ Build” properties page (top-level):
◦Uncheck “Use default build command” and enter this for the custom build command: python ${IDF_PATH}/tools/windows/eclipse_make.py.

      事实上 我按照默认的 build command 使用 make 而不是使用python ${IDF_PATH}/tools/windows/eclipse_make.py.
      也照样可以编译 通过, 这到底是什么原因呢? 感觉乐鑫做的文档还真是到处是坑~~~


4. 关于 .c 文件中 存在的部分 Symbol 'CONFIG_LOG_DEFAULT_LEVEL' could not be resolved  ,build的时候也不会报错,也是编译得过去~~这就奇怪了,如果没有resolved 又怎么能编译过呢?

最近编辑记录 mkseven32 (2018-05-04 13:49:49)

离线

#9 2018-05-04 13:56:36

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,223
积分: 9197

Re: 如何 使用eclipse 搭建esp32 开发环境?

1. 实际上只要执行 eclipse -> 从Makefile 导入工程, 配置好环境变量就可以了(ADF_PATH/IDF_PATH, PATH)
esp-adf 的 example只要配置 ADF_PATH
esp-idf 的 example只要配置 IDF_PATH

那个python脚本生成 eclipse工程没有用过。

4. 【could not be resolved】这种问题你不去理他也没关系, 因为这是源码导航/浏览用的,和编译系统没有关系。





离线

楼主 #10 2018-05-04 14:03:10

mkseven32
会员
注册时间: 2018-04-24
已发帖子: 57
积分: 57

Re: 如何 使用eclipse 搭建esp32 开发环境?

晕哥 说:

1. 实际上只要执行 eclipse -> 从Makefile 导入工程, 配置好环境变量就可以了(ADF_PATH/IDF_PATH, PATH)
esp-adf 的 example只要配置 ADF_PATH
esp-idf 的 example只要配置 IDF_PATH

那个python脚本生成 eclipse工程没有用过。

4. 【could not be resolved】这种问题你不去理他也没关系, 因为这是源码导航/浏览用的,和编译系统没有关系。


但目前 对于第二点  建立 工程的时候  exiting code location 的问题还是不明白

参考网上其他人的成功案例 http://nevel.cnblogs.com/p/6290903.html 也是千差万别~~~


谢谢!


这就让我 更加 纠结  官方教程中
•On the next page, enter “Existing Code Location” to be the directory of your IDF project. Don’t specify the path to the ESP-IDF directory itself (that comes later). The directory you specify should contain a file named “Makefile” (the project Makefile).

到底是啥子意思~~~

离线

#11 2018-05-04 14:28:15

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,223
积分: 9197

Re: 如何 使用eclipse 搭建esp32 开发环境?

Import New Project
Eclipse makes use of the Makefile support in ESP-IDF. This means you need to start by creating an ESP-IDF project. You can use the idf-template project from github, or open one of the examples in the esp-idf examples subdirectory.
Once Eclipse is running, choose File -> Import...
In the dialog that pops up, choose "C/C++" -> "Existing Code as Makefile Project" and click Next.
On the next page, enter "Existing Code Location" to be the directory of your IDF project. Don't specify the path to the ESP-IDF directory itself (that comes later). The directory you specify should contain a file named "Makefile" (the project Makefile).
On the same page, under "Toolchain for Indexer Settings" choose "Cross GCC". Then click Finish.

我估计他想表达的意思是,
别选错目录了,不能选 esp-idf 根目录,
你选一个 example下面的工程目录。
这里确实有点歧义。





离线

楼主 #12 2018-05-05 09:55:49

mkseven32
会员
注册时间: 2018-04-24
已发帖子: 57
积分: 57

Re: 如何 使用eclipse 搭建esp32 开发环境?

晕哥 说:

Import New Project
Eclipse makes use of the Makefile support in ESP-IDF. This means you need to start by creating an ESP-IDF project. You can use the idf-template project from github, or open one of the examples in the esp-idf examples subdirectory.
Once Eclipse is running, choose File -> Import...
In the dialog that pops up, choose "C/C++" -> "Existing Code as Makefile Project" and click Next.
On the next page, enter "Existing Code Location" to be the directory of your IDF project. Don't specify the path to the ESP-IDF directory itself (that comes later). The directory you specify should contain a file named "Makefile" (the project Makefile).
On the same page, under "Toolchain for Indexer Settings" choose "Cross GCC". Then click Finish.

我估计他想表达的意思是,
别选错目录了,不能选 esp-idf 根目录,
你选一个 example下面的工程目录。
这里确实有点歧义。

嗯,但一开始我选example下面的工程目录,看里面也有Makefile ,同时也看不出有什么关联性~~~

没想到真的是选整个 源码包 才可以1!!

谢谢你!

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn