View Full Version : Is there a search path in the enviroment settings?

08-05-2010, 07:32 PM
Hey Guys

Delphi has three ways to find files:

> It looks in the same directory as the unit that is using the file
> It looks in the project's search path
> It looks in the enviroment search path

I guess the first two things work the same in Lazarus, but how about the third?
I can't seem to find any search-path setting that is global for all projects. Does Lazarus have this?

Thanks :)

08-05-2010, 10:35 PM
You can edit the fpc.cfg file located in your fpc installation directory, and put any global search paths using -FuPATH (for units)and -FiPATH for include files. You can also put an asterisk * at the end of the path to make fpc look into all subdirectories of that path. I think that is the only 'global' way.

There are some issues with this approach though, identifier completion does not work as it should as Lazarus can not check the directories specified in the fpc.cfg file. Also when debugging Lazarus may ask you to find the required sources.

Note that you can save Lazarus compiler options to a file. You can make a template project, list all the paths of units in the options and save this to a file, and then load it for each project you need.