gpt4 book ai didi

c++ - MSB6004 指定的任务可执行位置 "\rc.exe"无效

转载 作者:太空宇宙 更新时间:2023-11-04 12:42:20 25 4
gpt4 key购买 nike

我正在尝试构建 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

我确实看到了 this posting在 SO 上,建议使用 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 变体,但我确实尝试了两者。正如我提到的,问题确实似乎是 \

我尝试了上述的所有排列。

想法?

最佳答案

有关此 MS 开发人员社区帖子的详细信息 link ,如果 WDK 版本与 SDK 版本不匹配,那么您会收到此错误。

在我的例子中,我不得不降级 SDK 版本。

关于c++ - MSB6004 指定的任务可执行位置 "\rc.exe"无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53583330/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com