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,
However, when I try to compile them, it is said no such file or directory like this
If you can help me, I will APRECIATE A LOT.
By the way, there are also such error in text:
Barin
July 18, 2019, 9:32am
#3
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
Eden
July 18, 2019, 10:35am
#6
can you open the directory of the folder “Omni_computeMatrics” for us to view?
Barin
July 18, 2019, 8:56pm
#7
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:
Hi Aditya, I’ll reply here and not through your email.
Copy the Makefile in src into your subdirectory bodilyFuncs (or whatever). Modify line 4 to go from:
ROOT=..
to
ROOT=../..
then, in the Makefile at the root directory, modify line 8 from:
SUBDIRS=src
to
SUBDIRS=src src/bodilyFuncs
And do the same thing for all your other directories.
hotel
July 18, 2019, 10:34pm
#8
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.