Hi All,
This might be simple to some..I have tried searching the web and tried quite a few things but to no avail. I am not sure what i am missing so please hear me out.
I followed Espressif's excellent guide ceating a C project and managed to successfully build and flash the blinky. Openocd debugging works as well using an external FTDI module. C is OK. All working.
However, I have no success using C++ so far. I copied Kolbans gpio.cpp and .h files from his cpputils and incorporated it directly in my project as a form of basic sanity setup. I am not using it as a component.
It seems that that the header files are not available even though the intellisense is able to see it.
In short, i am unable to build if i include any header files from myincludes folder into my main.cpp since it complains as no such file or directory.
I am not sure what settings do i need to modify as i am not that familiar with Makefiles. Even the path looks weird with both backslash and forward slash present.
fatal error: myinclude/cpp_pwm.h: No such file or directory
make: *** [C:\msys32\home\Fadster\esp\esp-idf/make/project.mk:468: component-main-build] Error 2
Appreciate any kind guidance. Thanks.
best,
Fadster
Struggling with "No such file or directory" problem
Re: Struggling with "No such file or directory" problem
I have a very similar problem.
I receive the message:
Makefile:8: C:\mysys32\home\Andreas\esp\esp-idf/make/project.mk: No such file or directory
make: *** No rule to make target 'C:\mysys32\home\Andreas\esp\esp-idf/make/project.mk'. Stop.
This happens on every project I create other than the first project. If I copy the first project and substitute all the various source files the project "make"s successfully. If I build the project from scratch I get the error.
I cant find any difference in the setup, I follow the espressif instructions.
I get the same mixed directory characters (\ /) as you.
Any help or suggestions appreciated.
A Kotowski
I receive the message:
Makefile:8: C:\mysys32\home\Andreas\esp\esp-idf/make/project.mk: No such file or directory
make: *** No rule to make target 'C:\mysys32\home\Andreas\esp\esp-idf/make/project.mk'. Stop.
This happens on every project I create other than the first project. If I copy the first project and substitute all the various source files the project "make"s successfully. If I build the project from scratch I get the error.
I cant find any difference in the setup, I follow the espressif instructions.
I get the same mixed directory characters (\ /) as you.
Any help or suggestions appreciated.
A Kotowski
Re: Struggling with "No such file or directory" problem
One of the "gotchas" with Eclipse support is that intellisense may follow a different set of include paths to the actual build. The include path dialog you show in the screenshot is only used for Eclipse IDE, not for the "real" build. If you follow the Eclipse Setup in the IDF Programming Guide, then Eclipse will be configured to "learn" the include paths from the build system, and if everything works correctly no manual editing of include paths is needed on the Eclipse side. However some other Eclipse guides recommend typing the paths in manually here, in which case they can get out of sync if you're not careful.
(A better solution for using Eclipse with ESP-IDF is being worked on now and we hope to announce it soon.)
To understand how to update the makefiles, take a look at the build system guide and particularly the section on project layout. The project structure you have now and the recommended layout for an IDF project are a bit different.
I would recommend the following:
- Make a directory PROJECT_DIR/components/cpp_driver and a directory PROJECT_DIR/components/cpp_driver/include.
- Move the headers from "myinclude" to PROJECT_DIR/components/cpp_driver/include (you can put them in "include/myinclude" subdir if you want to include them as "myinclude/header" instead of "header").
- Move the corresponding source files from "cpp_driver" to PROJECT_DIR/components/cpp_driver.
- Create a file component.mk in components/cpp_driver with the following contents:.
Code: Select all
COMPONENT_SRCDIRS := .
COMPONENT_ADD_INCLUDEDIRS := include/
- To have Eclipse code completion continue to work, you'll have to either update the include paths in the Eclipse project settings or follow the Eclipse Setup section of the IDF Programming Guide section linked above, so the paths are automatically "learned" after the first build.
Re: Struggling with "No such file or directory" problem
Hi Andreas,
I think your problem is different (for one, the type of file in the error message is different). It looks like maybe there is a typo in your IDF_PATH variable, is the directory really "C:\mysys32" not "C:\msys32"?
Re: Struggling with "No such file or directory" problem
Thank you! Sorry I am blind.
Now I am back to the original issue I cant get Flash to build. Here is the end of the console output:
App "console" version: v4.0-dev-71-g5beb2802e-dirty
Building component project variables list /home/Andreas/esp/esp-idf/examples/system/console/build/app_update/component_project_vars.mk
make[1]: Leaving directory '/home/Andreas/esp/esp-idf/examples/system/console/build/app_update'
including /home/Andreas/esp/esp-idf/components/app_update/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/bootloader/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/bootloader_support/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/coap/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/efuse/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/esp32/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/esptool_py/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/mbedtls/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/nghttp/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/partition_table/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/ulp/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/unity/Makefile.projbuild...
make: *** No rule to make target 'Flash'. Stop.
"make -j4 Flash" terminated with exit code 2. Build might be incomplete.
Any suggestions?
Now I am back to the original issue I cant get Flash to build. Here is the end of the console output:
App "console" version: v4.0-dev-71-g5beb2802e-dirty
Building component project variables list /home/Andreas/esp/esp-idf/examples/system/console/build/app_update/component_project_vars.mk
make[1]: Leaving directory '/home/Andreas/esp/esp-idf/examples/system/console/build/app_update'
including /home/Andreas/esp/esp-idf/components/app_update/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/bootloader/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/bootloader_support/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/coap/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/efuse/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/esp32/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/esptool_py/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/mbedtls/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/nghttp/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/partition_table/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/ulp/Makefile.projbuild...
including /home/Andreas/esp/esp-idf/components/unity/Makefile.projbuild...
make: *** No rule to make target 'Flash'. Stop.
"make -j4 Flash" terminated with exit code 2. Build might be incomplete.
Any suggestions?
Re: Struggling with "No such file or directory" problem
Yes that works!
Thank You
A Kotowski
Thank You
A Kotowski
Who is online
Users browsing this forum: No registered users and 146 guests