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

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.

Leave a Comment