The problem in my case was that i deleted the registry key HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\23.0\Library\Win32\Search Path
. When i restored it with the original value $(BDSLIB)\$(Platform)\release;$(BDSUSERDIR)\Imports;$(BDS)\Imports;$(BDSCOMMONDIR)\Dcp;$(BDS)\include
the project compiled fine again.