Struggling with "No such file or directory" problem

fadster
Posts: 1
Joined: Sun Mar 24, 2019 9:33 am

Struggling with "No such file or directory" problem

Postby fadster » Sun Mar 24, 2019 10:06 am

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
path_symbols.jpg
path_symbols.jpg (58.42 KiB) Viewed 22733 times
pic2.jpg
pic2.jpg (79.01 KiB) Viewed 22733 times

akotowski
Posts: 16
Joined: Sat Sep 01, 2018 2:54 pm

Re: Struggling with "No such file or directory" problem

Postby akotowski » Mon Apr 01, 2019 4:59 pm

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

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Struggling with "No such file or directory" problem

Postby ESP_Angus » Tue Apr 02, 2019 1:22 am

fadster wrote:
Sun Mar 24, 2019 10:06 am
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.
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/
- Done! You've just created an IDF component called "cpp_driver" in your project, with one include directory and one source directory. Your project will automatically find this component when you build it.
- 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.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Struggling with "No such file or directory" problem

Postby ESP_Angus » Tue Apr 02, 2019 1:24 am

Hi Andreas,
akotowski wrote:
Mon Apr 01, 2019 4:59 pm
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
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"?

akotowski
Posts: 16
Joined: Sat Sep 01, 2018 2:54 pm

Re: Struggling with "No such file or directory" problem

Postby akotowski » Tue Apr 02, 2019 11:25 pm

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?

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Struggling with "No such file or directory" problem

Postby ESP_Angus » Wed Apr 03, 2019 3:18 am

akotowski wrote:
Tue Apr 02, 2019 11:25 pm
"make -j4 Flash" terminated with exit code 2. Build might be incomplete.
Make targets are case sensitive. Try "make -j4 flash".

akotowski
Posts: 16
Joined: Sat Sep 01, 2018 2:54 pm

Re: Struggling with "No such file or directory" problem

Postby akotowski » Wed Apr 03, 2019 2:31 pm

Yes that works!

Thank You

A Kotowski

Who is online

Users browsing this forum: Google [Bot] and 76 guests