MSB6004指定的任务可执行位置“ \ rc.exe”无效

时间:2018-12-02 18:31:43

标签: c++ windows visual-studio wdk rc

我正在尝试构建USBView(Windows驱动程序示例之一)。我是昨天从Github下载的。

问题是Visual Studio尝试在根\ rc.exe处查找资源编译器。该目录\显然不存在,因此指定实际位置并将其放置在路径中没有x86或x64方位。 Visual Studio需要找到rc.exe而不是\rc.exe,只是我不知道VS是从哪里提取\的。

usbview Property Pages - Configuration Properties | VC++ Directories

我什至可以将目录添加到我的系统PATH变量中(然后重新启动):

System Environment Variable showing x86 Windows Kit location

我确实在SO上看到this posting,它建议使用NuGet软件包管理器将Microsoft.Net.Compilers添加到项目中。这个建议失败了。

对于它的价值,这是VS屏幕截图:

Visual Studio Microsoft.CppCommon.targets showing RC section

内部版本的诊断输出没有帮助。

1>Target "BeforeResourceCompile" in file "C:\Program Files (x86)\Microsoft\Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets":
1>Done building target "BeforeResourceCompile" in project "usbview.vcxproj".
1>Target "MakeDirsForResourceCompile" in file "C:\Program Files (x86)\Microsoft\Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets":
1>  Added Item(s): RcDirsToMake=C:\Users\Sarah\Downloads\Projects\Windows-driver-samples-master\usb\usbview\Debug
1>  Task "MakeDir"
1>    Task Parameter:Directories=C:\Users\Sarah\Downloads\Projects\Windows-driver-samples-master\usb\usbview\Debug
1>  Done executing task "MakeDir".
1>  Removed Item(s): RcDirsToMake=C:\Users\Sarah\Downloads\Projects\Windows-driver-samples-master\usb\usbview\Debug
1>Done building target "MakeDirsForResourceCompile" in project "usbview.vcxproj".
1>Target "_SelectedFiles" skipped. Previously built successfully.
1>Target "SelectCustomBuild" skipped. Previously built successfully.
1>Target "SelectResourceCompile" in file "C:\Program Files (x86)\Microsoft\Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets":
1>Done building target "SelectResourceCompile" in project "usbview.vcxproj".
1>Target "ResourceCompile" in file "C:\Program Files (x86)\Microsoft\Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets":
1>  Using "RC" task from assembly "C:\Program Files (x86)\Microsoft\Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Build.CppTasks.Common.dll".
1>  Task "RC"
1>    Task Parameter:Source=uvcview.rc
1>    Task Parameter:
1>        AdditionalIncludeDirectories=
1>            Debug\
1>            C:\Program Files (x86)\Microsoft\Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\atlmfc\include
1>    Task Parameter:Culture=0x0409
1>    Task Parameter:
1>        PreprocessorDefinitions=
1>            _X86_=1
1>            i386=1
1>            STD_CALL
1>            WIN32_LEAN_AND_MEAN=1
1>            _WIN32_WINNT=0x0A00
1>            WINVER=0x0A00
1>            WINNT=1
1>            NTDDI_VERSION=0x0A000004
1>            DBG=1
1>            SMP_ID=\"{54E86405-9C3D-4F0F-B65C-AB86DE455DD7}\"
1>    Task Parameter:ResourceOutputFileName=Debug\uvcview.res
1>    Task Parameter:SuppressStartupBanner=True
1>    Task Parameter:TrackerLogDirectory=Debug\usbview.tlog\
1>    Task Parameter:MinimalRebuildFromTracking=True
1>    Task Parameter:ToolArchitecture=Native32Bit
1>    Task Parameter:ToolPath=\
1>    Task Parameter:TrackFileAccess=True
1>    All source files are not up-to-date: missing command TLog "C:\Users\Sarah\Downloads\DevExpress\Projects\Windows-driver-samples-master\usb\usbview\Debug\usbview.tlog\rc.command.1.tlog".
1>    C:\Program Files (x86)\Microsoft\Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1498,5): error MSB6004: The specified task executable location "\rc.exe" is invalid.
1>  Done executing task "RC" -- FAILED.
1>Done building target "ResourceCompile" in project "usbview.vcxproj" -- FAILED.
1>
1>Done building project "usbview.vcxproj" -- FAILED.

Microsoft似乎每天都会更新Visual Studio,如果不是更频繁的话,但是这里是我输入此语句时的版本。我有Windows 10 Pro x64,就永久更新而言还不错。

Microsoft Visual Studio 2017 version - About Box

Win32确实等同于x86变体,但我确实尝试了两者。正如我提到的,问题确实确实是\

我尝试了以上所有排列方式。

有想法吗?

1 个答案:

答案 0 :(得分:0)

有关此MS开发者社区帖子link的详细信息,如果WDK版本与SDK版本不匹配,则会出现此错误。

就我而言,我不得不降级SDK版本。