How do I fix warning MSB8012 in a static library project in Visual C++ 2010?

后端 未结 3 1114
温柔的废话
温柔的废话 2020-12-03 05:27

I am trying to convert a static library from VC++2008 to VC++2010, and I get these warnings about TargetPath and TargetName. I have had a look into my configuration and I\'m

3条回答
  •  无人及你
    2020-12-03 06:21

    The build system was dramatically overhauled in VS2010, it now uses MSBuild instead of the custom VCBuild system. The same build system used by other languages supported by VS. They did a pretty good job of making that invisible, old projects normally build just fine. But there are a few places where you can get in trouble when you import old projects. Which is what this warning is saying.

    Using the linker's General + Output File setting to name the output file is one such troublespot. Not actually that sure what can go wrong, it probably has something to do with dependency checking. The default setting for it is $(OutDir)$(TargetName)$(TargetExt). The best way to rename the output file is therefore to change the $(TargetName) macro value.

    Which is available on the main General page as the "Target Name" setting. It didn't exist in earlier VS versions. So change that one to "itk32d". Or better, $(ProjectName)d. And reset the linker setting.

提交回复
热议问题