Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 2010 警告MSB8012-链接器';s OutputFile属性值() 警告MSB8012_Visual Studio 2010_Visual C++_Msbuild_Msbuild 4.0_Linker Warning - Fatal编程技术网

Visual studio 2010 警告MSB8012-链接器';s OutputFile属性值() 警告MSB8012

Visual studio 2010 警告MSB8012-链接器';s OutputFile属性值() 警告MSB8012,visual-studio-2010,visual-c++,msbuild,msbuild-4.0,linker-warning,Visual Studio 2010,Visual C++,Msbuild,Msbuild 4.0,Linker Warning,我已经阅读了很多关于人们询问这个错误的答案,但是没有一个像我这样的问题。我试图在我的项目中使用属性表,以避免每次都必须设置属性设置,反过来,我在构建时得到了以下结果: 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

我已经阅读了很多关于人们询问这个错误的答案,但是没有一个像我这样的问题。我试图在我的项目中使用属性表,以避免每次都必须设置属性设置,反过来,我在构建时得到了以下结果:

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属性值就很容易了,但正如您所看到的,它会显示
链接器的OutputFile属性值()
(OutputFile值为null?),每次都有点不同
$(OutDir)$(TargetName)$(targettext)
我将它设置为

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

以下是一些相关设置:

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

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

常规->目标扩展:
.dll

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


起初我只是想忽略这个警告,但实际上它开始引起问题,所以如果有人能解决这个MS难题,我将非常感激。

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

如果您想为多个开发人员建立一个公共环境,那么属性表非常有用。它们使用起来有点笨拙,但一旦你掌握了窍门,仍然有用。