English 中文(简体)
MSBuild:<clcompile> with relative path issue
原标题:MSBuild : <clcompile> with relative path issue

I have some relative path in my *.vcxproj

<ItemGroup>
  <ClCompile Include="myFile.cpp" />
  <ClCompile Include="....SomeReferencefile.cpp" />
  <ClCompile Include="....SomeOther.cpp" />
</ItemGroup>
<ItemGroup>
  <ClInclude Include="......SomeOtherHeaders.h" />
  ...
</ItemGroup>

当我汇编时,它总是对这两个档案提出如下申诉:

fatal error C1083: Cannot open include file: StdAfx.h : No such file or directory
fatal error C1083: Cannot open include file: StdAfx.h : No such file or directory

每当把这些档案人工复制到载有我的File.cpp的目录时,它就会汇编成册。

So Any clue why does this happen? and How to fix it?

最佳回答

或许是因为......没有“StdAfx.h”档案。 部分参考。 当你把“StdAfx.h”列入时,它首先看着的是目前的名录;然后,它检查了在包括道路上配置的所有名录。

此外,我还随同我的File.cpp一样,给我写信。 当你将CPP的档案移至载有我的File.cpp的目录时,当它检查目前目录中的StdAfx.h时,它就继承了该目录并包括了该目录。 因此,档案的移解会解决这个问题。

If you want to make it work with the files in ....SomeReference, then you need to add myFile.cpp s directory to the include paths (in your project settings).

问题回答

暂无回答




相关问题
How can I overwrite file web.config with web.other.config?

I have a msbuild script with custom logic to deploy my service to the qa server automatically. I have to overwrite the default config with a dedicated one, but when I use <Copy SourceFiles="web....

How do I use MSBuild on a C# project with no compilable code

I have a C# web app project which actually has no ASP.Net or C# in it. It s just a single html page with some Javascript, CSS, and a couple of images. I want to use MSBuild to deploy a version of ...

您能否防止MSBuild.exe经营活动?

我用文字建造一些项目,偶尔利用习俗制造事件,给建筑系统造成了很大困难。 如果有可能,我想援引MSBuild.exe。

building .net applications without Visual Studio

I m interested to hear about people working with building .net applications using MSBuild, NAnt or similar tools. What are you using, why are you using it instead of the VS IDE? I like to use ...

How long does my Visual Studio C# compile take?

It seems like it should be possible to configure Visual Studio to print out how long the compile takes. Perhaps somewhere in the .sln file. If the sln is compiled from the command line using ...

热门标签