Friday, January 1, 2021

Warning MSB8012 TargetExt(.dll) does not match the Linker's OutputFile property value (.ocx). 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).

after I fix many error messages, the final one is:

Warning MSB8012 TargetExt(.dll) does not match the Linker's OutputFile property value (.ocx). 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). GDIPlusControl C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets 1217

I tested and find a good configuration for ActiveX Control project as below:

  1. Warning MSB8012 : make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile)
  2. the sensible one solution is:

    Simply use $(TargetFileName) instead of $(TargetName)$(TargetExt)

    My research is:

    Configuration Properties - > General -> Output Directory: set to "$(SolutionDir)$(Configuration)\"

    Configuration Properties - > General -> Target Name : set to: "$(ProjectName)"

    Configuration Properties - > General -> Target Extension: set to ".ocx"

    Configuration Properties - > Linker - > General -> output file : set to: "$(OutDir)$(ProjectName).ocx"

    learned from elsewhere: from Configuration Properties - > Linker -> General -> OutPut File -> $(OutDir)$(ProjectName).ocx

    then build this project and everything went well.

    it is also explained by upgrading guide behind the scene.

  3. Linker outfile property file does not match targetpath?
  4. Warning MSB8012: TargetPath and 'Linker's OutputFile' not evaluated the same way
  5. good links are contained and listed below:

  6. Visual Studio 2010 C++ Project Upgrade Guide
  7. 1) Linker output directory

    One of the warnings you may see when upgrading you applications is MSB8012: $(TargetPath) and Linker’s OutputFile property value does not match:

    – MSB8012: $(TargetExt) (‘.dll’) does not match the Linker’s OutputFile property value ‘C:\foo\Debug\MFCActiveX.ocx’ (‘.ocx’) in project configuration ‘Debug|Win32’. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetExt) property value matches the value specified in %(Link.OutputFile).

    – MSB8012: $(TargetPath) (‘C:\foo\Debug\MFCActiveX.dll’) does not match the Linker’s OutputFile property value ‘C:\foo\Debug\MFCActiveX.ocx’ (‘C:\foo\Debug\MFCActiveX.ocx’) in project configuration ‘Debug|Win32’. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Link.OutputFile).

    Link.OutputFile is the value defined at Linker -> General -> Output File on the property page. By default, its value is $(OutDir)$(TargetName)$(TargetExt), which is the same as the value of $(TargetPath). When we convert an application from a previous version, however, there is not an easy way for conversion to parse Link.OutputFile to figure out what exactly the values are for $(TargetName) and $(TargetExt), as different customers may have formatted them in different ways. To work around that, we decided to preserve the value of Linker.OutputFile during conversion. After conversion, $(TargetName) will default to $(ProjectName). $(TargetExt) will default to the default extension for the application type: .dll for Dynamic Library, .lib for Static Library and .exe for Application. Link.OutputFile value will be preserved. Warning MSB8012 will be issued in the conversion log if Link.OutputFile and $(TargetPath) are not the same. You will get the same warnings when building the application.

    $(OutDir), $(TargetName) and $(TargetExt) are exposed on the “General” property page, as “Output Directory”, “Target Name”, “Target Extension”, respectively. You can manually change the values of these properties so that you no longer get the warning.

    -If your project produces Import Library (Linker -> Advanced -> Import Library), you may need to change the Output folder of the Import Library as well after conversion if the Linker output directory is not the default output directory. Otherwise, the generated import lib maybe in a different directory than the linker output.

    -Debugging.Command is set to default $(TargetPath) after conversion. You may need to make changes so that the right executable will be launched upon F5 (Debugging) or Ctrl + F5 (Start without debugging).

  8. VS2010 warning MSB8012
  9. New Research

  10. warning MSB8012 : make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile)
  11. I am getting the following error when building my code.

    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(E:\Study\FWIF\demola\ext-libs\libcommoncpp2-1.6.0\w32\Debug\ccgnu2.dll) does not match the Linker's OutputFile property value g\CapeCommon14.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).

  12. How do I fix warning MSB8012 in a static library project in Visual C++ 2010?
  13. 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 not sure how to make these go away. Is it serious or is it really just an ignorable warning, for a static library that I usually build once and rarely rebuild.

    I think it has something to do with the fact that the project is named itk32, but the debug version of the library is named itk32d.lib, and the old way that this is configured in Visual C++ 6.0 era has resulted in some kind of weird settings staying in the vc2010 project, which was converted a while ago from VC6 to 2008, and I am now converting to 2010:

  14. Linker outfile property file does not match targetpath?
  15. I'm trying to compile a C++ type .DLL for a SierraChart custom study. (Which is a financial trading application.) Here is the warning I get that I need to fix so it all points to the linker output value:

  16. How do I fix warning MSB8012 in a static library project in Visual C++ 2010?
  17. 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.

  18. warning MSB8012 : make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile)
  19. I am getting the following error when building my code.

    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(E:\Study\FWIF\demola\ext-libs\libcommoncpp2-1.6.0\w32\Debug\ccgnu2.dll) does not match the Linker's OutputFile property value g\CapeCommon14.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).

  20. Warning MSB8012: TargetPath(...) does not match the Linker's OutputFile property value
  21. Question :Warning MSB8012: TargetPath(...) does not match the Linker's OutputFile property value 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)

    Answer: Right click on Properties > Linker > General > Output File to

    < inherit from parent or project defaults >
    Or
    $(OutDir)$(TargetName)$(TargetExt)

  22. This is a paragraph.

  23. 关于Visual Studio 2010:警告MSB8012:确保$(OutDir),$(TargetName)和$(TargetExt)属性值与%(Link.OutputFile)中指定的值匹配

No comments:

Post a Comment