简体   繁体   中英

Delphi XE - Fatal: F1027 Unit not found: 'System.pas' or binary equivalents (.dcu)

During compilation of Delphi project, following error is given by the compiler:

Fatal: F1027 Unit not found: 'System.pas' or binary equivalents (.dcu)

This happens only when building though msbuild using TFS build system.

Works fine when executed through command line as below.

Command:C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\msbuild.exe E:\\Src\\Project\\sample.groupproj /v:m /t:Build /p:Config=Release

The following execution through MSbuild fails:

<Exec Command="C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\msbuild.exe E:\\Src\\Project\\Sample.groupproj /v:m /t:Build /p:Config=Release"/>

Note:Following env variables are set : BDS,BDSLIB,BDSCOMMONDIR,BDSINCLUDE

When executed through CCNET dcc32.exe has extra arguments such as -I,-LE,-LN,- O,-R,-U,-NB,-NH,but execution through TFS does not have the these argument list.

Any thoughts on how to resolve these errors.

Thanks in Advance....

It is possible that your environment is not configured properly. First call the RSVARS.BAT file located in the BIN directory of your Delphi installation prior to calling msbuild.

If you are calling this from another build system, my suggestion would be to create a simple batch/cmd file that will call RSVARS.BAT followed by executing MSBUILD and have your build system invoke that instead.

If you try to invoke RSVARS.BAT separately, it will modify its copy of the environment then exit, which will effectively do nothing to the parent environment. Adding a call to RSVARS.BAT from within the MSBUILD script will also fail for the same reason. The RSVARS.BAT must be called from the same contextual environment (or higher) as the MSBUILD task.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM