1

I have two projects in Visual Studio 2010 that I want to share the precompiled header outputs .pch(i) file: one builds it and the other should only use it.

After Clean, and Rebuild Project1, the .pchi file is created.

Rebuild Project2 does a strange thing, it Deletes the .pchi file and then complains that can't find it for compilation.

What should I change to stop this behaviour (possibly in the file "Microsoft.Cpp.x64.Intel C++ Compiler XE 12.0.targets"?) ?

I've set the file to read-only, then of course Project2 Build complains:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\PlatformToolsets\Intel C++ Compiler XE 12.1\Microsoft.Cpp.x64.Intel C++ Compiler XE 12.1.targets(84,5): error MSB3061: Unable to delete file ".pchi". Access to the path '.pchi' is denied.

at the line#84 the .targets file has

< Delete Condition="'%(ClCompile.DebugInformationFormat)' != '' and '%(ClCompile.DebugInformationFormat)' != 'OldStyle' and '%(ClCompile.ProgramDataBaseFileName)' != '' and !Exists(%(ClCompile.ProgramDataBaseFileName)) and '%(ClCompile.UseMSVC)'!='true' and '%(ClCompile.InterproceduralOptimization)'!='MultiFile' and '%(ClCompile.LevelOfStaticAnalysis)'!='Brief' and '%(ClCompile.LevelOfStaticAnalysis)'!='Medium' and '%(ClCompile.LevelOfStaticAnalysis)'!='Verbose'" Files="%(ClCompile.PrecompiledHeaderOutputFile)i" />

littleadv
  • 20,100
  • 2
  • 36
  • 50
rych
  • 682
  • 3
  • 10
  • 22

0 Answers0