警告MSB8012-链接器的OutputFile属性值()

问题描述 投票:1回答:2

警告MSB8012

我已经阅读过许多回答有关此错误的人的答案,但似乎没有一个像我这样的问题。我试图在项目中使用属性表来节省每次都要设置属性设置的麻烦,而我又在构建时使用了它:

2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(989,5): warning MSB8012: TargetPath(C:\MyProj\Release\MyProj.dll) does not match the Linker's OutputFile property value (). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetExt(.dll) does not match the Linker's OutputFile property value (). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(991,5): warning MSB8012: TargetName(MyProj) does not match the Linker's OutputFile property value (). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).

如果要做的就是更改链接程序的OutputFile属性值,这很容易,但是如您所见,它每次都显示Linker's OutputFile property value ()(OutputFile值为null?),这与$(OutDir)$(TargetName)$(TargetExt)有点不同我将其设置为...

我在属性表中配置的唯一内容是一些调试设置,一些优化设置,添加构建后事件并禁用unicode。这就是我所需要的,但是即使我删除了属性表,该问题也仍然存在于项目中。我根本没有像以前的许多版本一样从Visual Studio的早期版本转换项目,而是尝试添加和配置属性表。

以下是一些相关设置:

常规->输出目录:$(SolutionDir)$(Configuration)\

常规->目标名称:$(ProjectName)

常规->目标扩展:.dll

链接器->输出文件:$(OutDir)$(TargetName)$(TargetExt)

起初我只是忽略此警告,但它实际上开始引起问题,因此,如果有人能弄清楚这个MS难题,我将非常感谢。

visual-studio-2010 visual-c++ msbuild msbuild-4.0 linker-warning
2个回答
0
投票

它似乎开始对所有项目产生影响,所以我重新安装了Visual Studio,问题消失了……我现在不敢尝试再次使用属性表,但是总比没有好。我想这都是MS的错。


0
投票

这是MS另一个令人难以置信的愚蠢变化。具有自动化的生产版本需要能够选择.obj,.lib,.pdb和二进制文件的位置。这些新内容通过在每个人上强制执行自己的模式来破坏生产构建/自动化。

[抱歉,我正在寻找答案。我没有解决办法。找到一个我就回来。

© www.soinside.com 2019 - 2024. All rights reserved.