vs2010中,MSBuild與C++編譯器無縫整合.無論使用vs2010生成的代碼,還是轉換vs2008或者是更低版本vs編譯的C++代碼.都會在工程編譯后,都會提示一條錯誤:
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(935,5): warning MSB8012: TargetPath(c:\users\kalmbach\documents\visual studio 2010\Projects\CPP_DLL2\..\bin\CPP_DLL2d.dll) does not match the Linker's OutputFile property value (c:\users\kalmbach\documents\visual studio 2010\Projects\bin\CPP_DLL2d.dll). 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 %(Link.OutputFile).
于是Google一下, 結果在這里發現了大家都發現同樣的問題
我這里的編譯習慣是這樣的, 調試版無論dll, lib還是exe,都在工程名后加d加擴展名組成最后的名稱,例如
cored.lib engined.lib , Release版本沒有d
因此,為了避免這個warning,只用將調試版的General節點上Target Name的值改為$(ProjectName)d
而有些工程的Librarian或者Link分支的Output File的值在轉換升級的過程中會被修改. 同樣可以統一修改為vs2010的風格$(OutDir)$(TargetName)$(TargetExt)