[Lazarus] Cannot find inc file from a registered package...

Bo Berglund bo.berglund at gmail.com
Tue Jun 23 21:10:44 CEST 2020

I am porting a Delphi application, which uses Indy10, to fpc/lazarus
and I have run into a problem regarding an include directive in one
source file:

{$I IdCompilerDefines.inc}

This is a file within the Indy package, on Delphi it is found in the
Indy sources in the directory where the Indy10 package is installed:


And Delphi has no problem finding it.

In Lazarus otoh I get the error message:

class_SSRemoteServer.pas(84,2) Fatal: Cannot open include file

I have added indylaz as a "Required Package" for the project but it
does not solve this problem even though it solved a few other Indy
related errors.

What are you supposed to do in order to make Lazarus find this file?

And if you wonder, I do not know why the include directive is present
in the source (they are more than a decade old)...

It works fine in Delphi 2007, but gives an error in Lazarus 2.0.8 on
My final target is Linux but first I want to get it running on

Googling brought up this:
where it is stated that:

If you include a file in your source with the {$I filename} directive,
the compiler will look for it in the following places:

1. It will look in the path specified in the include file name. 
2. It will look in the directory where the current source file is. 
3. it will look in all directories specified in the include file
search path.[/quote]

But afaik you do not enter full paths into FPC/Lazarus sources, a
registered package should handle this...

And I don't even know where Lazarus has stored the package sources
during installation of indylaz so I cannot enter that into the project
properties either.

Bo Berglund
Developer in Sweden

More information about the lazarus mailing list