Delph XE2 Error E2158

 When I compile my projects in FB with Delphi XE2  I get these error message for some of my projects 

c:\program files (x86)\embarcadero\rad studio\9.0\SOURCE\RTL\SYS\System.Variants.pas(960) Fatal: E2158 System.Variants unit out of date or corrupted: missing '@VarCast'

or 

 

c:\program files (x86)\embarcadero\rad studio\9.0\source\data\bde\BDE.pas(4897) Fatal: E2226 Compilation terminated; too many errors

or 
KGsMenuService_Impl.pas(16) Fatal: F1026 File not found: 'ExtCtrls.dcu'
 

 

I used the global Lib and use build with packages

my projects compiles ok in Delphi XE2

 

 

 

 

 

Why do you have the RTL/VCL Source code in your library path ? Your library paths should be pointing at the lib folders, this is what I have :

c:\program files (x86)\embarcadero\rad studio\9.0\lib\Win32\release;C:\Users\Anne\Documents\RAD Studio\9.0\Imports;c:\program files (x86)\embarcadero\rad studio\9.0\Imports;C:\Users\Public\Documents\RAD Studio\9.0\Dcp;c:\program files (x86)\embarcadero\rad studio\9.0\include

The global library paths that we use are pulled from the registry, which suggests that you have added the delph rtl/vcli source folders to your library path. If you are doing that then they must all be before any lib folders (and it’s not recommended unless you know what you are doing).

 In my library path Ihave 

$(work)\$(Config)\$(Ver);c:\program files (x86)\embarcadero\rad studio\9.0\lib\Win32\release;\\filer1\user\u068181\Documents\RAD Studio\9.0\Imports;c:\program files (x86)\embarcadero\rad studio\9.0\Imports;C:\Users\Public\Documents\RAD Studio\9.0\Dcp;c:\program files (x86)\embarcadero\rad studio\9.0\include;C:\Program Files (x86)\FastReports\LibD16;c:\program files (x86)\embarcadero\rad studio\9.0\RaveReports\Lib;

and the libraries to our 3rd party components

In my search path I have 

$(work)\$(Config)\$(Ver);$(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\fmx;$(BDS)\source\databinding\components;$(BDS)\source\databinding\engine;$(BDS)\source\databinding\graph;$(BDS)\source\fmi;$(BDS)\source\data;$(BDS)\source\data\ado;$(BDS)\source\data\bde;$(BDS)\source\data\cloud;$(BDS)\source\data\datasnap;$(BDS)\source\data\dbx;$(BDS)\source\data\dsnap;$(BDS)\source\data\Test;$(BDS)\source\data\vclctrls;C:\Program Files (x86)\FastReports\LibD16;

and sources to our 3rd party components

 

In my search path I have

>$(work)$(Config)$(Ver);$(BDS)\SOURCE\VCL;$(BDS)\source\rtl\common;

Why? Why are you compiling the Delphi RTL/VCL library source code?

In any event, on the Directories Page, make sure you have the correct FrameWork Type selected, Delphi XE uses Namespace prefixes to differentiate between the different frameworks it uses.


 Thanks a lot for your suggestions. 

I changed the searchpath (removed all the BDS stuff) and that did the trick for most errors.

I also forgotten for some delphi actions to set the framework correctly so that took care of the rest of the problems

 

Thanks again