Delphi on Windows x64: solution when project compiles fine under IDE, but not using MSBuild
Posted by jpluimers on 2015/04/21
Especially when using Delphi 2007 on Windows x64 system (8.x, 7, Vista, 2012 Server, 2008 Server, …), the Delphi specific .Targets files used by msbuild are simply installed to the wrong location.
A better warning for this is in my BeSharp.net repository: Run-Dependend-rsvars-From-Path.bat thanks to David Millington who wrote this:
If you copy
- Borland.Common.Targets
- Borland.Cpp.Targets
- Borland.Delphi.Targets
- Borland.Group.Targets
from
- %windir%\Microsoft.NET\Framework\v2.0.50727
to
- %windir%\Microsoft.NET\Framework64\v2.0.50727
then building via the command line works.
The rsvars.bat file is correct.
Note that my batch file checks for all target file sets:
Delphi 2007:
set requiredTargets=Borland.Common.Targets Borland.Cpp.Targets Borland.Delphi.Targets Borland.Group.Targets
Delphi 2009 and up:
set requiredTargets=CodeGear.Common.Targets CodeGear.Cpp.Targets CodeGear.Delphi.Targets CodeGear.Deployment.Targets CodeGear.Group.Targets CodeGear.Idl.Targets CodeGear.Profiles.Targets if %bdsVersion%==8 set requiredTargets=CodeGear.Common.Targets CodeGear.Cpp.Targets CodeGear.Delphi.Targets CodeGear.Group.Targets CodeGear.Idl.Targets if %bdsVersion%==13 set requiredTargets=CodeGear.Common.Targets CodeGear.Cpp.Targets CodeGear.Delphi.Targets CodeGear.Deployment.Targets CodeGear.Group.Targets CodeGear.Profiles.Targets
–jeroen
via [WayBack] QualityCentral: Project compiles fine under IDE, but not using MSBuild.






Delphi Continuous Integration: When you get E2202 “Required package ‘rtl’ not found” or F1027 “Unit not found: ‘System.pas’” « The Wiert Corner – irregular stream of stuff said
[…] a set of targets files that gather information about the projects and environment. Over time the targets files for Delphi historically are named CodeGear.*.Targets and perform the Delphi (and C++ Builder) specific parts […]
David M said
That’s a blast from the past…!
Oddly enough I can’t see my name in that QC report, but instead the name of a QA staff member for the company I was working for at the time. Where did you see it? (It’s quite possible it’s there – at the time I was “the” Delphi guy, and I know other staff sometimes borrowed my QC account when they needed to do something, post bugs, comment on reports, etc.)
jpluimers said
The name of the reporter changed from your name to Alan Garny since I first read it.