6

I have both Delphi 2010 and XE2 installed on my machine (Windows 7, 64bits). I use FinalBuilder 5.5 to build my Delphi projects, which calls DCC32.exe to do a full build.

Now that I upgraded my project from Delphi 2010 to XE2, I'm facing this issue: MSBuild keeps calling Delphi 2010 dcc32.exe (ie. C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\Bin\dcc32.exe) instead of XE2's dcc32.exe

I went & updated path in environment as well as bds path, but it didn't help.

How can I fix this?

TheDude
  • 3,045
  • 4
  • 46
  • 95

2 Answers2

9

You need to set all the appropriate environment variables in your build environment. The way to do this is to execute the rsvars.bat script in the Delphi bin directory.

My other tip is to remove all Delphi entries from your system path. This forces you to be explicit about setting the appropriate environment variables for the correct version.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • 1
    Just my two cents about the fact that MSBuild is no so perfect. So much circumvolutions to let use the expected compiler! This was exactly my point in http://stackoverflow.com/questions/13916132/what-is-the-minimal-agent-install-footprint-for-delphi-build-automation/13918676#13918676 :) – Arnaud Bouchez Jan 05 '13 at 10:35
  • 1
    @Arnaud Calling a single .bat file isn't that hard. – David Heffernan Jan 05 '13 at 10:40
  • Not hard. But now you have FinalBuilder running CMD.EXE running a batch which wil execute another batch to run MSBUILD loading some XML content then running DCC32. This is what I called circumvolutions. It will work, it will be unnoticeable in speed (or?), but I do not like that. This is perfectly suggestive. But why did they add a dependency to MSBuild in Delphi? Not to reinvent the wheel? Or to add another dependency to the .NET SDK Delphi is not using? OK. So use Visual Studio, it is better integrated with MSBuild. And not so slower than Delphi XE3. Poor management decisions IMHO. – Arnaud Bouchez Jan 05 '13 at 18:15
  • @Arnaud Actually RAD Studio's integration with msbuild was better until VS2010. Anyway, you can do it how you like. I just answered the question! I enjoy the debate but perhaps this isn't where to hold it. – David Heffernan Jan 05 '13 at 19:43
  • Thank you guys, I found [this approach](http://stackoverflow.com/questions/8068481/how-to-build-using-msbuild-and-delphi-xe2) which basically uses .bat to explicitly set paths by calling the correct rsvars.bat and calls MSBuild. It worked for me, so I basically combined both approaches suggested by you (MSBuild + batch)...I'm happy! – TheDude Jan 05 '13 at 23:13
1

Go To "Windows Environment Variables" setting, find the variable "Path".

Please check and make sure the path to your "....\Rad Studio\9.0\bin" (Delphi XE2 version) is located before any folder that contain dcc32.exe (Older delphi version). This usually happens when you install newer Delphi version into machine that already installed with older delphi version.

Albert
  • 29
  • 2