【问题标题】:warning MSB8012 - Linker's OutputFile property value ()警告 MSB8012 - 链接器的 OutputFile 属性值 ()
【发布时间】:2013-02-17 21:59:17
【问题描述】:

警告 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?),这与 @987654323 有点不同@我设置为...

我在属性表中配置的唯一内容是一些调试设置、一些优化设置、添加构建后事件和禁用 unicode。这就是我所需要的,但这个问题现在卡在项目中,即使我删除了属性表。我根本没有从以前版本的 Visual Studio 转换项目,就像许多收到此警告的人一样,只是尝试添加和配置属性表。

以下是一些相关设置:

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

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

常规->目标扩展:.dll

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

起初我只是想忽略这个警告,但它实际上开始引起问题,所以如果有人能弄清楚这个 MS 谜题,我将不胜感激。

【问题讨论】:

    标签: visual-studio-2010 visual-c++ msbuild msbuild-4.0 linker-warning


    【解决方案1】:

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

    【讨论】:

    • 如果您想为多个开发人员设置一个公共环境,属性表非常有用。它们使用起来有点尴尬,但一旦你掌握了窍门,它仍然很有用。
    猜你喜欢
    • 1970-01-01
    • 2011-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-09
    • 2012-09-02
    • 2013-12-16
    • 2011-05-19
    相关资源
    最近更新 更多