Delphi can't find System.dcu; what should the default path settings be?

20,882

Solution 1

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

Solution 2

Top Line of the library path:

$(BDSLIB)\$(Platform)\release

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

Solution 3

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

Solution 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

Solution 5

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

Share:
20,882

Related videos on Youtube

pop33
Author by

pop33

Updated on October 24, 2020

Comments

  • pop33
    pop33 about 3 years

    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
      pop33 over 12 years
      No way. There must be an alternative...
  • pop33
    pop33 over 12 years
    Can you tell what files you have in $(BDSUSERDIR)\Imports? BDSUSERDIR=C:\Users\<Username>\Documents\RAD Studio\8.0. No such 'imports' folder there. Is it empty?
  • pop33
    pop33 over 12 years
    It works now, but I really want to know what is in that directory. Thanks!
  • Ken White
    Ken White over 12 years
    The Imports folder is for imported type libraries. I haven't imported any into XE yet, so the folder has nothing in it.
  • ThievingSix
    ThievingSix almost 12 years
    This is actually what fixed it for me.
  • Cohen
    Cohen about 11 years
    I finally found this for Delphi 2010 on a x64 machine under: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\CodeGear\BDS\7.0\Lib‌​rary
  • Jeroen Wiert Pluimers
    Jeroen Wiert Pluimers about 10 years
    +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.
  • Kapytanhook
    Kapytanhook about 10 years
    This fixed it for me too, i pressed "remove invalid paths" and it took: $(BDSCOMMONDIR)\Dcp\$(Platform) and: $(BDSLIB)\$(Platform)\release
  • Bianca
    Bianca over 9 years
    This one solved my problem too. But i got one annoying notes: {Greyed items denote invalid path} - after i delete those note, again my IDE will not compile. Can i ignore this ?
  • Alexandru Lucian Susma
    Alexandru Lucian Susma almost 9 years
    this fixed it for me. I was missing the "$(BDSLIB)\$(Platform)\release;... in the library path. I did however had it in the other path. Include Path :/
  • Machado
    Machado over 7 years
    Dude that is awesome.
  • Reversed Engineer
    Reversed Engineer over 6 years
    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...
  • LMSingh
    LMSingh almost 6 years
    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\<CorpName>\BDS\xx.y\‌​Library\Win32. Here <CorpName> is either CodeGear or Embarcadero and xx.y is the Delphi version. For any cases not mentioned here, search for <CorpName> from top of the registry and under that look for "BDS" or "Delphi" and then under that <version>\Library
  • Nasreddine Galfout
    Nasreddine Galfout over 4 years
    I could kiss now (I'm a Muslim so you now how grateful I'm now ).

Related