Visual Studio relative path for Output Directory macro doesn't seem to be working properly

StackOverflow https://stackoverflow.com/questions/19124033

سؤال

I'm receiving the following build warning when attempting to compile a .sln for Chromium:

Warning 1   warning MSB8012: TargetPath(C:\chromiumtrunk\chromium\src\base\allocator\..\..\build\Debug\allocator_extension_thunks.lib) does not match the Library's OutputFile property value (C:\chromiumtrunk\chromium\src\build\Debug\lib\allocator_extension_thunks.lib). 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 %(Lib.OutputFile).    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppBuild.targets   1299    5   allocator_extension_thunks

It is complaining that this path:

C:\chromiumtrunk\chromium\src\base\allocator\..\..\build\Debug\allocator_extension_thunks.lib

doesn't match the expected path:

C:\chromiumtrunk\chromium\src\build\Debug\lib\allocator_extension_thunks.lib)

but... "\base\allocator..\..\" should cancel out... right? The only other difference between the two paths is the fact that the .lib gets output to a /lib folder. This seems correct. I don't understand how I should be properly resolving this message.

I'm happy to provide any information necessary. I assume it's just a simple variable tweak, but a bit lost..

C/C++ -> General -> Output Directory: '..\..\build\$(Configuration)\
C/C++ -> General -> Intemeradiate Directory: '$(OutDir)obj\$(ProjectName)\
Librarian -> General -> Output File: $(OutDir)lib\$(ProjectName).lib
هل كانت مفيدة؟

المحلول

Yes, the extra "lib" produces this warning, the two paths do not match. Not actually sure what goes wrong, the final .lib file does end up in the lib directory even though MSBuild reports it wrong in the build completion message. Short from that bad message, I'd guess at an issue with automatic dependencies. This friction got introduced at VS2010 when they moved from the custom VCBuild to MSBuild.

If you want to get rid of the warning then restore the library project's Output File setting to $(OutDir)$(TargetName)$(TargetExt) and change the Output Directory to ..\..\build\lib\$(Configuration).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top