Linker outfile property file does not match targetpath?

29,947

Solution 1

I believe this warning appears specifically when upgrading a C++ project to VS2010. Visual Studio 2010 C++ Project Upgrade Guide describes some of the caveats encountered during an upgrade. If you're uncomfortable changing project settings, then retaining the older version of Visual Studio, may work for you.

To change the %(Link.OutputFile), open the project properties. Navigate to Configuration Properties -> Linker -> General. You can set the Output File to $(OutDir)\SCStudies.dll, which should take care of your issue. You may need to repeat the change for each Configuration/Flavor you will be building (Debug/x86, Release/x86, Debug/Itanium, etc...).

Solution 2

Based on this answer.

I changed the following property:

Linker -> General -> Output File to "$(OutDir)$(TargetName)$(TargetExt)"

This prevented the warning to appear and the output was generated successfully.

Solution 3

A different fix which others haven't mentioned is that by default the TargetExt is .exe and for my debug builds I changed it to be _d.exe, where instead you should be doing that in the TargetName path.

Solution 4

The original configuration was set like:

Properties -> Linker -> General : $(OutDir)\"<'name fileA>".exe

The program tries to run "<'name_project>".exe and as result error Linked.

You need to set the configuration as:

Properties -> Linker -> General : $(OutDir)\"<'project name>".exe

Share:
29,947
FinDev
Author by

FinDev

Updated on July 07, 2022

Comments

  • FinDev
    FinDev almost 2 years

    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:

    warning MSB8012:
    
    TargetPath(C:\SierraChart\VCProject\Release\SCStudies.dll) does not match the Linker's 
    OutputFile property value (c:\sierrachart\data\SCStudies.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).
    
    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets
    

    Any idea what's wrong?