warning MSB8012 : make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile)

后端 未结 8 1806
忘掉有多难
忘掉有多难 2020-12-02 14:25

I am getting the following error when building my code.

C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\Microsoft.CppBuild.targets(990,5):

相关标签:
8条回答
  • 2020-12-02 15:21

    I managed to fix a similar issue by editing the vcxproj file manually.

    The OutDir and TargetName settings were at the bottom of the project file.

       ...
          <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
            <OutDir>$(OUTPUT_DIRECTORY)\</OutDir>
            <IntDir>$(ProjectDir)\$(Configuration)\$(ProjectName)\</IntDir>
            <TargetName>$(ProjectName)</TargetName>
          </PropertyGroup>
       </Project>
    

    Moving the block above the ClCompile block solved the issue.

    0 讨论(0)
  • 2020-12-02 15:23

    I solved this by comparing the project to a very similar project that was working properly. All of the settings in the project properties matched but I found the following extra lines in the vcxproj file of the malfunctioning project:

    <Lib>
       <OutputFile>.\MCtlDrvX.lib</OutputFile>
    </Lib>
    

    I deleted them and the message went away and the output went to the directory specified in the project settings.

    0 讨论(0)
提交回复
热议问题