I have started a new C++ project under Visual Studio 2010 and I run into warning MSB8012 after I change the Output File setting under Project Properties->Configuration Properties->Linker->General. By default it is $(OutDir)$(TargetName)$(TargetExt)
), but I need to change it to $(OutDir)Bin\$(ConfigurationName)\$(TargetName)$(TargetExt)
.
If I do that, I run into said warning. I have never had this problem under Visual Studio 2005 and 2008.
The error message tells me, that my TargetPath does not match the Linker's OutputFile property value. The resolved command line looks exactly like I want it to be, but the TargetPath value is missing the Bin\$(ConfigurationName)
part. Where exactly is the TargetPath property value set/assembled?
The message contains To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
Does this mean, that the OutputFile property can only have its default value?
How can I resolve this warning without resetting the Output File property or using some goofy workaround?
You can fix this with Configuration Properties + General, Output Directory setting. Change it to
$(SolutionDir)Bin\$(ConfigurationName)
And leave the linker setting as-is. This setting change modifies the value of $(OutDir) and keeps MSBuild happy.