12

Got this error whenever I try to compile something: "F1027 Unit not found: 'System.pas' or binary equivalents (.dcu)".

Got it after installing a component, removed it, reinstalled RAD studio, but still same.

In order to get it fixed, I need the Library path and browsing path. Please anybody post yours so I get it working.

A workaround I found is including the path "$(BDS)\lib\win32\debug" to Library path, but this is not the correct way. So I need your paths. Thanks!

pop33
  • 135
  • 1
  • 1
  • 5
  • I don't usually support the advice I'm about to give, but on this ocassion it seems like the appropriate thing to do: reinstall Windows then reinstall Delphi. – Cosmin Prund Apr 01 '11 at 18:37
  • 4
    No way. There must be an alternative... – pop33 Apr 01 '11 at 18:40
  • What version of Delphi? The appropriate paths are different for each one. We know it's 2006 or higher, because you're using $(BDS), but that's all. – Ken White Apr 01 '11 at 18:42
  • XE, it was noted in the tags. ^^ – pop33 Apr 01 '11 at 18:44
  • Did you, maybe, install RAD Studio as one user and you're now logged on as a different user? – Cosmin Prund Apr 01 '11 at 18:46
  • @pop33: I swear I looked there. :) I apparently need new glasses. – Ken White Apr 01 '11 at 18:56
  • Check your environment variables, do you have BDS and the others? You'll also have to check the contents of the Embarcadero registry key. I stand by my original advice, reinstalling Windows will cure it all. Take the opportunity and install onto a virtual machine and this will never happen to you again (if it does you just take the VM image from your last backup and you're back coding) – Cosmin Prund Apr 01 '11 at 19:13

5 Answers5

14

This is from the HKLM\Software\Embarcadero\BDS\8.0\Library key in the registry - you can save it to a .reg file and then import it (making any necessary fixes to the paths first, of course):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Embarcadero\BDS\8.0\Library]
"Browsing Path"="$(BDS)\\SOURCE\\VCL;$(BDS)\\source\\rtl\\common;$(BDS)\\SOURCE\\RTL\\SYS;$(BDS)\\source\\rtl\\win;$(BDS)\\source\\ToolsAPI;$(BDS)\\SOURCE\\IBX;$(BDS)\\source\\Internet;$(BDS)\\SOURCE\\PROPERTY EDITORS;$(BDS)\\source\\soap;$(BDS)\\SOURCE\\XML;$(BDS)\\source\\db;$(BDS)\\source\\Indy10\\Core;$(BDS)\\source\\Indy10\\System;$(BDS)\\source\\Indy10\\Protocols;$(BDS)\\source\\database;"
"Debug DCU Path"="$(BDSLIB)\\$(Platform)\\debug;$(BDS)\\RaveReports\\Lib"
"HPP Output Directory"="$(BDSCOMMONDIR)\\hpp"
"Language Library Path"="$(BDSLIB)\\$(Platform)\\release\\$(LANGDIR);$(BDS)\\lib\\$(LANGDIR)"
"Package DCP Output"="$(BDSCOMMONDIR)\\Dcp"
"Package DPL Output"="$(BDSCOMMONDIR)\\Bpl"
"Package Search Path"="$(BDSCOMMONDIR)\\Bpl"
"Translated Debug Library Path"="$(BDSLIB)\\$(Platform)\\debug\\$(LANGDIR)"
"Translated Library Path"="$(BDSLIB)\\$(Platform)\\release\\$(LANGDIR)"
"Translated Resource Path"="$(BDSLIB)\\$(Platform)\\release\\$(LANGDIR)"
"Search Path"="$(BDSLIB)\\$(Platform)\\release;$(BDSUSERDIR)\\Imports;$(BDS)\\Imports;$(BDSCOMMONDIR)\\Dcp;$(BDS)\\include;C:\\Program Files\\Raize\\CS4\\Lib\\RS-XE;;$(BDS)\\RaveReports\\Lib"

For MSBuild to work properly (and for project configurations), you need to make sure the following environmental variable is set properly:

PLATFORM=ANYCPU
Ken White
  • 123,280
  • 14
  • 225
  • 444
  • Can you tell what files you have in $(BDSUSERDIR)\Imports? BDSUSERDIR=C:\Users\\Documents\RAD Studio\8.0. No such 'imports' folder there. Is it empty? – pop33 Apr 01 '11 at 19:23
  • It works now, but I really want to know what is in that directory. Thanks! – pop33 Apr 01 '11 at 19:38
  • 1
    The Imports folder is for imported type libraries. I haven't imported any into XE yet, so the folder has nothing in it. – Ken White Apr 01 '11 at 20:13
  • I finally found this for Delphi 2010 on a x64 machine under: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\CodeGear\BDS\7.0\Library – Cohen Aug 30 '12 at 10:41
  • 1
    +1; thanks this helped me restoring the `Browsing Path` when some component install overwrote it with the `Search Path` value. Not sure yet which component install this was though. – Jeroen Wiert Pluimers Aug 11 '13 at 17:56
  • NOTE: If HKLM subtree doesn't exist then look at HKEY_CURRENT_USER\Software\Embarcadero\BDS\xx.y\Library or as @Cohen mentioned, something like HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\\BDS\xx.y\Library\Win32. Here is either CodeGear or Embarcadero and xx.y is the Delphi version. For any cases not mentioned here, search for from top of the registry and under that look for "BDS" or "Delphi" and then under that \Library – LMSingh Jan 25 '18 at 11:06
11

Top Line of the library path:

$(BDSLIB)\$(Platform)\release

Some installers mistakenly parse this as two lines and split them out.

scottostanek
  • 161
  • 2
  • 3
5

Check on your Delphi IDE menu: Tools * Options, to see what is defined. My default installation has 2 important "Environment Variables", BDSLIB, defined as "c:\program files\embarcadero\rad studio\8.0\lib" Platform, defined as "Win32".

On that same form, under Library, is defined Library path:, the path begins "$(BDSLIB)\$(Platform)\release;...

That should equate to C:\program files\embarcadero\rad studio\8.0\lib\Win32\release", which is where you should find System.dcu. Make sure that file is there. Maybe it was removed or damaged by your component work. There is also a "Debug" directory under Win32 which should have the dcu with the debug information included. If the release dcu is missing or damaged, you can probably copy the debug version in as a quick test.

It sounds like the compiler couldn't find the dcu then also looked for the source file to recreate it. But it should normally use the dcu.

I believe the source is in PF\Embarcadero\Rad Studio\8.0\source\rtl\sys as system.pas.

All of the above is the default Delphi Options. The options can also be changed for a project, which could interfere with the above. Try the above first. Then create a new project and see if it will complile, as that will use the defaults only.

Patrick New York

Patrick Moloney
  • 642
  • 5
  • 14
4

Take a look at the -cleanregistryide option on this page:

http://support.embarcadero.com/es/article/42597

It will allow you to restore the IDE's default installation paths. If you use this option, third-party add-in's would need to be reinstalled. I have experienced this problem after upgrade installations when there were installed 3rd party IDE tools.

HTH Navid

user998198
  • 133
  • 7
1

For XE4 use this restore.reg

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Embarcadero\BDS\11.0\Library\Win32]

"Search Path"="$(BDS)\Imports;$(BDSCOMMONDIR)\Dcp;$(BDS)\include;C:\Program Files (x86)\Embarcadero\RAD Studio\11.0\lib;C:\Program Files (x86)\Embarcadero\RAD Studio\11.0\include;C:\Program Files (x86)\Embarcadero\RAD Studio\11.0\Imports;$(BDSLIB)\$(Platform)\release;$(BDSUSERDIR)\Imports;$(BDS)\Imports;$(BDSCOMMONDIR)\Dcp\$(Platform);$(BDS)\include"

You can change 11.0 to your version of Delphi

Cr0c_rus
  • 11
  • 1
  • Thank you!! Or paste the path from this answer into Tools > Options > Delphi Options > Library Path (choosing 32-bit Windows if that's what you're using). Note that this removes paths to installed libraries, so these should be saved first, then added back... – Reversed Engineer May 03 '17 at 09:15