Include paths : which order?

Hello all !

One question about how paths are handled in “include” statements.

My freefem++.pref file contains this :
includepath += “./”
includepath += “/Users/fabred/StabFem_DEVELOP/StabFem/SOURCES_FREEFEM/INCLUDE/”

And my programs contain this:
include “SF_AutoInclude.idp”

The file “SF_Autoinclude.idp” may be either in the current path “./” or in the directory “/Users/fabred/StabFem_DEVELOP/StabFem/SOURCES_FREEFEM/INCLUDE/” . I want to use the one in the current directory if present or a default one in the other directory if not. This does not work, and freefem wants to use the default one in all case.

Can someone indicate me a rule that forces to look for include files in the current directory in priority ?

Thanks
David

1 Like

When I was trying to reproduce your work, I encountered the following difficulties:
9 : include “SF_AutoInclude.idp” Error opening file SF_AutoInclude.idp in:
– try :“SF_AutoInclude.idp”
– try :“D:\Program Files (x86)\FreeFem++\idp\SF_AutoInclude.idp”

Error line number 9, in file StabFem.idp, before token SF_AutoInclude.idp
lex: Error input opening file
current line = 9
Compile error : lex: Error input opening file
line number :9, SF_AutoInclude.idp
error Compile error : lex: Error input opening file
line number :9, SF_AutoInclude.idp
code = 1 mpirank: 0
try getConsole C:\Users\Owner\Desktop\free_fem\O-S equation\Newton_2D.edp
I don’t have the SF_AutoInclude.idp source code .If you had, could you share with me. If you solve the problem without this software, could I know how you can fix it?
We look forward to hearing from you and thank you in advance for your help.