[Makefile Maybe?] No such file or directory

Hi,guys.
I tried to import some functions I had wrote outside the pros, they are many .c files and .h files.

I created some folders in order to make them systematic,

image

However, when I try to compile them, it is said no such file or directory like this
image

If you can help me, I will APRECIATE A LOT.

By the way, there are also such error in text:
image

Change it to read:

#include "Onmi_computeMatrics/onmi_computeMatrics.h"

Also, I believe you will need to modify the Makefile in order to compile code in subdirectories of src.

I have tried using full path, it still dont work.
I guess it is the problem of makefile which causes the trouble.

but how should I modify the makefile?1

can you open the directory of the folder “Omni_computeMatrics” for us to view?

Using the full relative path from the project root in #include, as I suggested, will allow the compiler to find your header files.

However, the compiler still does not do anything with the accompanying source code files. To fix that, you will need to do something like this:

No, it uses a recursive wildcard search pattern to compile everything in the src directory, even if in nested folders.

The post you linked was for a much older version of the makefile, from back when we were doing PROS 2 releases.

2 Likes

Yes, you are right. The example shows above is old.
I am not familiar with makefile.
So I just don’t use subfolder and include every .h and .c files in my “opcontrol.cpp”

Now it works. But I still willing to hear some technical solutions.