1

I am attempting to build USBView, one of the Windows driver samples. I downloaded that from Github yesterday.

The problem is that Visual Studio attempts to find the resource compiler at the root, \rc.exe. That directory, \, obviously does not exist, so specifying the real location and placing that in the path has no bearing, x86 or x64. Visual Studio needs to find rc.exe not \rc.exe just I do not know from where VS pulled \.

usbview Property Pages - Configuration Properties | VC++ Directories

I even went so far as to add the directory to my system PATH variable (and rebooted):

System Environment Variable showing x86 Windows Kit location

I did see this posting on SO, which suggested adding Microsoft.Net.Compilers to the project using NuGet Package Manager. That suggestion failed.

For whatever it is worth, here is the VS screenshot:

Visual Studio Microsoft.CppCommon.targets showing RC section

The diagnostic output from the build is less then helpful.

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 seems to update Visual Studio on a daily basis, if not more frequently, however here is the version at the moment that I am typing this sentence. I have Windows 10 Pro x64, which also is not as bad with respect to perpetual updates.

Microsoft Visual Studio 2017 version - About Box

Win32 does equal the x86 variant, but I did try both. As I mentioned, the problem really does appear to be the \.

I tried all permutations of the above.

Thoughts?

Sarah Weinberger
  • 15,041
  • 25
  • 83
  • 130
  • VS2017 is normally installed into a subdirectory named "Microsoft Visual Studio". But it is "Microsoft" on yours. Uh oh. How did this happen? – Hans Passant Dec 02 '18 at 22:20
  • @HansPassant I believe in following MS own standard of `PF//`. Internally, Microsoft does that. I just follow through. As to "how" 1) I wanted the install that way 2) MS asks you what directory to install to during setup. 3) I organize the Start Menu the same way, which is a bit more work, but all Microsoft is under Microsoft. Period. Ditto for Adobe. – Sarah Weinberger Dec 02 '18 at 22:27
  • Hmya, they haven't followed that standard for at least two decades, possibly more. The SDK installer is notoriously feeble. Period. – Hans Passant Dec 02 '18 at 22:44

1 Answers1

0

Per details on this MS Developer Community post link, if the WDK version doesn't match the SDK version then you can get this error.

In my case I had to downgrade the SDK version.

JackR1
  • 81
  • 6