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

时间:2013-02-17 21:59:18

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

警告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值为空?),这有点不同$(OutDir)$(TargetName)$(TargetExt)我将其设为......

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

以下是一些相关设置:

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

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

常规 - >目标扩展程序:.dll

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

起初我只是忽略了这个警告,但它确实开始引起问题,所以如果有人能弄清楚这个MS难题,我将非常感激。

1 个答案:

答案 0 :(得分:0)

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