Home
Delphi
 

Cry about...
Delphi Troubleshooting


Unable to locate file "XXXX"


Symptom:

Within the Delphi development environment, right clicking a function and selecting 'Find Declaration' causes the following error message to appear:

Unable to locate file "XXXX"

where "XXXX" is typically one of "windows.pas", "system.pas", "sysutils.pas", e.g.

Unable to locate file "Windows.pas"

or

Unable to locate file "sysutils.pas"

Cause:

The editor is trying to locate the definition of the function requested, however the source file containing the definition is either missing or the editor is looking for it in the wrong place.

Possible Remedies:

  • The file "Windows.pas" is located in "$(DELPHI)\Source\Rtl\Win". This may be missing from the browsing path. To check, go to Tools, Environment options. Select the "Library" tab, and ensure that "$(DELPHI)\Source\Rtl\Win" is included somewhere in the browsing path. Add it if necessary, ensuring that there is a semi colon (';') between the existing path and the new entry.
  • The files "system.pas" and "sysutils.pas" are missing from the Delphi 6 (Personal Edition) distribution (they should be located in $(DELPHI)\Source\Sys). Delphi 6 Update 2 (available for download from www.borland.com) should contain these files (but didn't seem to when I tried it) but this may be deliberate for the Personal edition.

These notes are believed to be correct for Delphi 6, but may apply to other versions as well.