TRK0005 error locating rc.exe building VC++ 2015 project
Asked Answered
C

3

23

I have a VS 2015 C++ project (64-bit Windows 10 + Windows 10 SDK).

With the Project Properties > General > Target Platform Version set to "8.1", everything builds fine.

When I change it to "10.0.15063.0", I hit this error:

Error TRK0005 Failed to locate: "rc.exe". The system cannot find the file specified.

I saw from other posts that the fix is to paste the exe to somewhere it can be found. I'm looking for something a bit more solid (e.g. version controlled).

When set to 8.1, the $(WindowsSDK_ExecutablePath) macro includes this path:

C:\Program Files (x86)\Windows Kits\8.1\bin\x86

with rc.exe in it.

When set to 10.0.15063.0, none of the paths in the macro have an rc.exe inside them. If I add this path to the Executable Directories, the problem goes away:

C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64

My questions:

  • Is what I'm seeing expected or should rc.exe be found out-the-box?
  • Is it safe for me to add this extra path or am I likely to break something?
  • Am I using the correct extra path? (The 8.1 path includes "x86".)

Thanks

Charismatic answered 6/4, 2017 at 15:27 Comment(3)
That is only a sensible choice for UWP apps, the kind you sell through the Store. Such apps never use rc.exe. You did not explain why you think you needed to change it.Silassilastic
Thanks Hans. I didn't know that. I'm writing a plugin for another desktop application. The change is being forced on us by that application's SDK / property sheets. Would you recommend sticking with 8.1 normally then? ThanksCharismatic
Did you checked the directory setting for all target?Gusset
R
1

1) rc.exe should be found out of the box. The issue may be related to a different Windows 10 SDK path schemes which was changed in newer Windows 10 SDKs. Please, check, if VS2015 files point to the folder C:\Program Files (x86)\Windows Kits\10\bin\x64 (You can see the value of the macro for $(WindowsSDK_ExecutablePath)). Latest Windows 10 SDK are installed in parallel subfolders so you may install different Windows 10 SDK, with folders like: C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64 C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64

If VS expects SDK in general folder - Windows Kits\10\bin\, you may copy rc.exe, rc.dll there from bin\10.0.15063.0\ (from \x86 to \x86, from \x64 to \x64).

This is inconsistency in VS2015 / Win 10 SDK install.

2) If you put actual rc.exe path into the Project Properties > Configuration Properties > Executable Directories, at the end, it is generally safe. Paths are iterated from left to right, and the last one will be searched only if .exe was not found in the previous predefined ones.

3) VS may build .rc resource files always with 32-bit rc.exe from \x86 folder, depending on the variable in Executable Paths. It may be set to $(WindowsSDK_ExecutablePath). This actually should not matter, as these are 32-bit / 64-bit versions of the compiler executables with equivalent functionality. You can track which compiler .exe files MSBuild invokes in Output window, if increase verbosity: Tools > Options > Projects and Solutions > Build and Run > MSBuild project build output verbosity > Detailed.

Rager answered 20/2, 2020 at 7:22 Comment(0)
K
1

Not the cleanest solution but here's how I solved it, as @Alexey said, I also have 2 SDKs, 10 and 8.1 and probably that's where the error came from. I just added the path:

C:\Program Files(x86)\Windows Kits\8.1\bin\x64

to the PATH in Windows environment variables enter image description here

Note: The x64 at the end of the path, needs to be changed if you are compiling for a different architecture.

In addition, the path is where the rc.exe is located on my PC, you should make sure that it is indeed in the same place on your PC as well.

Do not forget to close and reopen Visual Studio after the change to update the environment variables.

Kings answered 3/11, 2020 at 5:39 Comment(0)
S
0

I installed one of the latest Windows SDK version, 10.0.19041.0,and found that the rc.exe is there the architecture folder under the SDK version in the bin folder. Here is what I mean:

C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64

I found a number of default Macros already created so I use them to make the path more generic in case if I have to change the platform target to a differernt version.

This is the path using the Macro and it's working for me.

$(WindowsSdkDir)bin\$(WindowsTargetPlatformVersion)\$(PlatformTarget)

So, the rc.exe is there. You just need to find where it is and add its path to the VC++ Directories\Executable Directories in the configuration dialog.

Stunsail answered 16/7, 2021 at 6:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.