Delphi include files and the search strategy are different for the compiler and IDE
Posted by jpluimers on 2016/07/12
Recently I bumped into a thing that I’d long forgotten: the Delphi compiler treats searching for include files (any files used with the {$I} or {$include} directive differently:
- The compiler first searches the directory where the file that is including resides and then uses the project and IDE search paths.
- The IDE only uses the project and IDE search paths.
This means that when you press
Ctrl-Enteron the filename to be included you might edit a different file than the compiler will include.
So when a product has multiple include files with the same name in different sub-directories, then you must modify them all.
I’m not sure this is a bug or feature, so Embarcadero is free to put this in either their QA system or documentation system.
–jeroen






lextm said
Microsoft uses several years to resolve such inconsistency by developing Roslyn to power both the compiler and the IDE. I doubt Delphi has enough resource to do the same.
David Moorhouse said
If it behaves like a bug then …