配置vs2010工程时,发现warning
warning MSB8012: TargetPath(...) does not match the Linker's OutputFile property value
运行时提示找不到可执行程序。后来发现的输出文件(Link.OutputFile )与debugging的command不一致,这一点与vs2005不同。网上找到的资料给出如下解释:
http://social.msdn.microsoft.com/Forums/en/vcprerelease/thread/3c03e730-6a0e-4ee4-a0d6-6a5c3ce4343c
Link.OutputFile is the value defined at Linker -> General -> Output File on the property page. By default, its value is $(OutDir)$(TargetName)$(TargetExt), which is the same as the value of $(TargetPath). When we convert an application from a previous version, however, there is not an easy way for conversion to parse Link.OutputFile to figure out what exactly the values are for $(TargetName) and $(TargetExt), as different customers may have formatted them in different ways. To work around that, we decided to preserve the value of Linker.OutputFile during conversion. After conversion, $(TargetName) will default to $(ProjectName). $(TargetExt) will default to the default extension for the application type: .dll for Dynamic Library, .lib for Static Library and .exe for Application. Link.OutputFile value will be preserved. Warning MSB8012 will be issued in the conversion log if Link.OutputFile and $(TargetPath) are not the same. You will get the same warnings when building the application.
$(OutDir), $(TargetPath) and $(TargetExt) are exposed on the "General" property page, as "Output Directory", "Target Name", "Target Extension", respectively. You can manually change the values of these properties so that you get the expected value for $(TargetName) or $(TargetPath) and no longer get the warning. Once you make the change, the behavior should be pretty much the same as previous versions of Visual Studio.
Li Shao, MSFT
vs2010中,$(OutDir)、$(TargetName) 、 $(TargetExt)等可在工程property pages->configuration properties->general中设置
本文介绍了在使用VS2010时遇到的warning MSB8012问题及其解决方案。该警告源于转换后的工程中Linker的OutputFile属性值与TargetPath不符。文章提供了调整OutputDirectory、TargetName及TargetExtension属性的方法来消除这一警告。
676

被折叠的 条评论
为什么被折叠?



