MSB3073:命令“ mc:VCEnd”以代码1退出

时间:2019-09-13 05:36:04

标签: c++ log4cpp

我正在尝试在Visual Studio 2019中编译log4cpp_x86,但是它给我以下错误,enter image description here

我试图将项目的位置从D:更改为C :,但是问题仍然存在,并且我未将该文件夹标记为ReadOnly,但是它也无法正常工作。

当我单击错误即用MSB3073标记时,它也将我重定向到Microsoft.CppCommon.targets中的行,该行的xml标记为:

  <Exec Command="%(CustomBuildStep.Command)$(_BuildSuffix)"/> 

1 个答案:

答案 0 :(得分:0)

@HansPassant提出link是我的情况的半个解决方案,但是在执行该链接中建议的以下步骤之前,我将整个损坏了解决方案文件的log4cpp项目替换为xml标记,如下所示,

<CustomBuildStep> <Command>mc $(InputPath)</Command> </CustomBuildStep>

对于旧项目,其解决方案文件带有以下标记,

<CustomBuild Include="..\NTEventLogCategories.mc">
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug with Boost|Win32'">"$(VS100COMNTOOLS)vsvars32.bat" if not exist $(OutDir) md $(OutDir)
mc.exe -h "$(OutDir)" -r "$(OutDir)" "$(ProjectDir)..\%(Filename).mc"
rc.exe -r -fo "$(OutDir)%(Filename).res" "$(OutDir)%(Filename).rc"
link.exe /MACHINE:IX86 -dll -noentry -out:"$(OutDir)NTEventLogAppender.dll" "$(OutDir)%(Filename).res"
</Command>
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug with Boost|x64'">"$(VS100COMNTOOLS)vsvars32.bat" if not exist $(OutDir) md $(OutDir)
mc.exe -h "$(OutDir)" -r "$(OutDir)" "$(ProjectDir)..\%(Filename).mc"
rc.exe -r -fo "$(OutDir)%(Filename).res" "$(OutDir)%(Filename).rc"
link.exe /MACHINE:IX86 -dll -noentry -out:"$(OutDir)NTEventLogAppender.dll" "$(OutDir)%(Filename).res"
</Command>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug with Boost|Win32'">$(OutDir)NTEventLogAppender.dll;%(Outputs)</Outputs>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug with Boost|x64'">$(OutDir)NTEventLogAppender.dll;%(Outputs)</Outputs>
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(VS100COMNTOOLS)vsvars32.bat" if not exist $(OutDir) md $(OutDir)
mc.exe -h "$(OutDir)" -r "$(OutDir)" "$(ProjectDir)..\%(Filename).mc"
rc.exe -r -fo "$(OutDir)%(Filename).res" "$(OutDir)%(Filename).rc"
link.exe /MACHINE:IX86 -dll -noentry -out:"$(OutDir)NTEventLogAppender.dll" "$(OutDir)%(Filename).res"
</Command>
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(VS100COMNTOOLS)vsvars32.bat" if not exist $(OutDir) md $(OutDir)
mc.exe -h "$(OutDir)" -r "$(OutDir)" "$(ProjectDir)..\%(Filename).mc"
rc.exe -r -fo "$(OutDir)%(Filename).res" "$(OutDir)%(Filename).rc"
link.exe /MACHINE:IX86 -dll -noentry -out:"$(OutDir)NTEventLogAppender.dll" "$(OutDir)%(Filename).res"
</Command>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(OutDir)NTEventLogAppender.dll;%(Outputs)</Outputs>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)NTEventLogAppender.dll;%(Outputs)</Outputs>
      <Command Condition="'$(Configuration)|$(Platform)'=='Release with Boost|Win32'">"$(VS100COMNTOOLS)vsvars32.bat" if not exist $(OutDir) md $(OutDir)
mc.exe -h $(OutDir) -r $(OutDir) $(ProjectDir)..\%(Filename).mc
RC.exe -r -fo $(OutDir)%(Filename).res $(OutDir)%(Filename).rc
link.exe /MACHINE:IX86 -dll -noentry -out:$(OutDir)NTEventLogAppender.dll $(OutDir)%(Filename).res
</Command>
      <Command Condition="'$(Configuration)|$(Platform)'=='Release with Boost|x64'">"$(VS100COMNTOOLS)vsvars32.bat" if not exist $(OutDir) md $(OutDir)
mc.exe -h $(OutDir) -r $(OutDir) $(ProjectDir)..\%(Filename).mc
RC.exe -r -fo $(OutDir)%(Filename).res $(OutDir)%(Filename).rc
link.exe /MACHINE:IX86 -dll -noentry -out:$(OutDir)NTEventLogAppender.dll $(OutDir)%(Filename).res
</Command>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release with Boost|Win32'">$(OutDir)NTEventLogAppender.dll;%(Outputs)</Outputs>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release with Boost|x64'">$(OutDir)NTEventLogAppender.dll;%(Outputs)</Outputs>
      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(VS100COMNTOOLS)vsvars32.bat" if not exist $(OutDir) md $(OutDir)
mc.exe -h $(OutDir) -r $(OutDir) $(ProjectDir)..\%(Filename).mc
RC.exe -r -fo $(OutDir)%(Filename).res $(OutDir)%(Filename).rc
link.exe /MACHINE:IX86 -dll -noentry -out:$(OutDir)NTEventLogAppender.dll $(OutDir)%(Filename).res
</Command>
      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(VS100COMNTOOLS)vsvars32.bat" if not exist $(OutDir) md $(OutDir)
mc.exe -h $(OutDir) -r $(OutDir) $(ProjectDir)..\%(Filename).mc
RC.exe -r -fo $(OutDir)%(Filename).res $(OutDir)%(Filename).rc
link.exe /MACHINE:IX86 -dll -noentry -out:$(OutDir)NTEventLogAppender.dll $(OutDir)%(Filename).res
</Command>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(OutDir)NTEventLogAppender.dll;%(Outputs)</Outputs>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)NTEventLogAppender.dll;%(Outputs)</Outputs>
    </CustomBuild> 

然后,我按照@HansPassant的建议执行了链接的步骤,但是在那个link中,我没有遵循第一步(即下载新版本的log4cpp),而是将项目替换为旧项目然后按照该链接中的建议执行所有过程,就解决了我的问题。