no such file or directory but the directory is in the path
-
22-07-2019 - |
Question
Hello I am compiling a program with make but I get the error of No such file or directory but the file is in a directory of the path.
I have this #include "genetic.h", that file is in a directory called /home/myuser/toolbox/lib/genalg and in the PATH I have ...:/home/myuser/toolbox/lib/genalg, so I do not why make cannot find the library. Any ideas?. Thanks
Solution
Your shell path has nothing to do with how compiling works, the related paths are the library path (-L option on gcc) which is where the compiler looks for libraries and the include path (-I option on gcc) which is where the compiler looks for header files. Check this link out if you are using gcc.
OTHER TIPS
Includes don't use the same path that is used for finding executables. Check the documentation on your compiler for where it searches for includes.