0%

VS2012 waring MSB8012问题解决

上篇文章讲到了VS2012安装WTL的方法,安装完新建了一个WTL的项目,编译为Debug版时运行没有任何问题,但编译为Release版时报警告并且无法自动启动:

1
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(935,5): warning MSB8012: TargetPath(F:\xxx\xxx.exe) does not match the Linker’s OutputFile property value (F:\xxx\xxx.exe). 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).

大概意思是输出文件跟链接器的输出文件的配置不匹配。

解决方法如下,进入该项目的项目属性设置: 1. “配置属性”-》“常规”,“输出目录”和“中间目录”都改为:$(SolutionDir)$(Configuration)\ 2. “配置属性”-》“链接器”-》“常规”,“输出文件”改为:$(SolutionDir)$(Configuration)\$(TargetName)$(TargetExt)