VS2010: "Cannot find the resource compiler DLL. Please make sure the path is correct." - c++

I've been following theForger's win32 API tutorial, and I decided to open the menu_one.rc file to see its contents from within VS2010, and I got this error:
I've double-checked both locations and neither of the files actually exist. The only copies of rcdll.dll I have are located at:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\rcdll.dll and
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64\rcdll.dll
I've tried doing a repair install of the Windows SDK, but that didn't fix the problem. What should I do?

This thread mentions a registry issue:
I had been able to reproduce the issue with my pc with Windows 7 SP1 64 bit and VS2010 Sp1 installed.
What I had to is modify the following registry entries from
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows]
"CurrentVersion"="7.0"
"CurrentInstallFolder"="C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0\\"
to
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows]
"CurrentVersion"="7.0.30319"
"CurrentInstallFolder"="C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\"
And there were 2 keys under
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows]
which are
v7.0
v7.0A
I deleted v7.0 along with all its subkeys. And the problem is solved.

I was a little worried about changing the registry since I'm running on v8.0A, but I was able to fix the error by simply copying the rcdll.dll from previous version into the directory listed in the error message.

VonC's answer is helpful, but in my case it did not solve the problem. There was another registry key that needed to change.
To find that key, I searched regedit for v6.0A since that was the version in the path on my error dialog.
The dialog path was C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\rcdll.dll
Once the key containing v6.0A was found, I replaced the path with what it was on my machine:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin
I also updated the version strings to be v7.0A or 7.0.30319 depending on what the original value was. I found a few of version strings in sub-keys of my search result, so I applied the changes there as well.
On my machine, the key that Visual Studio was using was located in:
[HKEY_USERS\S-1-5-21-627493193-880714491-1605132347-6179\Software\Microsoft\Microsoft SDKs\Windows]

Related

Having trouble with setting up C++ in Visual Studio

I'm getting a common error on the issue that I'm having but nothing has worked:
1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\include\yvals.h(12,10): fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
I've been told to download the C++ dev kit again, the Windows SDK again, Reset my PC after download and manually change the path inside the file that can't find it.
As it turns out the file exists (and the Windows SDK too, I assume), Visual studio is just looking for it in the wrong spot, So I figure this is a setup issue. It exists in this location C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt. You could say why not just manually link to it? I have but then another file can't be found, so I change that and then another one can't be found and so on. I'd appreciate the help as this is the reason I get scared to use Visual Studio and go back running to Code, thank you!
Does this issue also occur if I create an empty C++ project and build it? If it works fine, this issue is more relevant to your current project.
Please check the target platform version of your project. Right click the project name and select ‘Properties’—‘Configuration Properties’—‘General’— ‘Windows SDK Version’ like the following, and select the Windows 10 SDK to have a try.
You could also refer to the method in this issue.
(PS:You need to make sure that the SDK you install is consistent with the operating system, for example if you use Win 11 then you should install the Windows 11 SDK.)

"The package System.Net.Http with version 4.1.1 could not be found in C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\."

I am trying to evaluate a software SDK for displaying PDF files. It comes with a few sample projects, but I am having problems building the C++ projects. I am pretty sure this is a problem with my local environment, but I have no idea how to fix it:
The projects come as a Visual Studio solution, to be used in Visual Studio 2017. Upon first opening it I was told to install missing features (VS17 was a plain install with no workloads before):
After installing that, and twiddling with platform toolset and the general platform target settings, I could finally build the C++ library part that creates a .dll file to be used by the other 2 C++ projects. (I could also confirm that this works fine, as the also included C# project used the library perfectly fine.)
But for the 2 remaining C++ projects I get this error on build:
The package System.Net.Http with version 4.1.1 could not be found in C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\. Run a NuGet package restore to download the package.
FunctionDemo
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets
377
Unfortunately I have no idea what "Use NuGet Package Restore to download them." means in that context - both the solution and all the projects have nothing listed when using Manage NuGet Packages... in Visual Studio. So I don't even know where this dependency comes from. (Are those part of the general SDKs I have installed maybe?)
Double clicking the error message opens C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets with this:
<ResolveNuGetPackageAssets Condition="Exists('$(FrameworkInjectionLockFile)')"
NuGetPackagesDirectory="$(FrameworkInjectionPackagesDirectory)"
RuntimeIdentifier="$(NuGetRuntimeIdentifier)"
TargetMonikers="$(NuGetTargetMonikerToInject)"
ProjectLockFile="$(FrameworkInjectionLockFile)">
But I guess this is pretty standard. Does this tell me something where the error comes from?
On the filesystem C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\System.Net.Http\4.1.1 indeed does not exist. Any tries to fill it manually (download the nuget package manually to a project, and copying the results here, using any solutions or commands to run I can find online) failed.
If found out that C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\ is the package source Microsoft Visual Studio Offline Packages which I can view via Options -> NuGet Package Manager -> Package Sources in Visual Studio 2017, but disabling it there didn't change anything about the error message.
Am I looking in the wrong place?
Is this really my local problem or a project problem?
How can I fix this problem?
I "fixed" this by getting the C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\System.Net.Http\4.1.1 folder from another developer. Then the error message switched to other packages, so in the end he sent me his full C:\Program Files (x86)\Microsoft SDKs\NuGetPackages and I copied folders over until it finally built.
Still not idea what caused this, must have been a missing payload or SDK that Visual Studio thinks was installed but really wasn't :/
Keeping the question unanswered though in the hopes that someone comes along that know the real fix.
This happened to me after upgrading from Visual Studio 2017 to 2019. While not the same file, my error was:
error APPX0702: Payload file 'C:\Program Files (x86)\Microsoft
SDKs\NuGetPackages\System.Private.ServiceModel\4.1.3\runtimes\win7\lib\netcore50\System.Private.ServiceModel.dll'
does not exist.
For whatever reason, after upgrading, both VS 2017 and VS 2019 were looking for this in C:\Program Files (x86)\Microsoft SDKs\NuGetPackages..., but I found it actually existed in the similarly named folder C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages... instead. I assume during the installation of VS 2019 this directory was created?
I manually copied the files over to where it was looking and then the build finally worked. The underlying issue isn't fixed, but maybe somebody smarter than me can explain why this happened in the first place.
For me disabling C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\ didn't work either. But then I had deleted it from Nuget.Config and it had finally solved the problem.

qt creator 5.10 failed to retrieve msvc environment error

i just installed qt creator 5.10 and i opened a simple widget application this is the error that i get even without running the application
:-1: error: Failed to retrieve MSVC Environment from "D:\pograml files\visual studio2\VC\Auxiliary\Build\vcvarsall.bat":
'chcp' is not recognized as an internal or external command,
operable program or batch file.
'wmic' is not recognized as an internal or external command,
operable program or batch file.
i haven't found any solutions for this, if anyone could help me i would be very thankful
When Qt starts, I used to get a list of 10 errors related to MSVC kit because each detected MSVC platform compiler has an Initialization script for setting environment. like:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat x86_amd64
I traced the failure by running all Initialization one by one on same command line (cmd) window; In the beginning I used to run only Initialization for x86_amd64 which runs without errors thus I didn't notice anything wrong. But on same window running Initialization for next compiler " ...\vcvarsall.bat x86_amd64" the error appeared which in my case was something like:
" ..program Files\MySQL\Utilities xxx was not expected at this time"
I just checked and found that path does not exist at all in my storage, so I removed it from PATH system env settings, and surprised things went normal after that!
To add to the answer of #John Wesley, I too had to alter my system's PATH enviroment variable to fix the "failed to retrieve msvc environment" error. However, my problem was slightly different.
In short, remove any unused directories from your PATH.
To explain, my PATH contained the following entries in the following order:
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;
C:\ProgramData\Oracle\Java\javapath;
C:\Program Files (x86)\Intel\iCLS Client\;
C:\Program Files\Intel\iCLS Client\;
C:\Windows\system32;
C:\Windows;
C:\Windows\System32\Wbem;
[lots more enties followed...]
Hence my case was different to John's because it already had the required entries of:
C:\Windows\system32;
C:\Windows;
C:\Windows\System32\Wbem;
The fix for my system was to delete the first two entries (which I do not need because I manually set my Java paths). After I did that, I reopened Qt Creator and it worked!
It has been working for the past week without problem, however, sometimes the message "failed to retrieve msvc environment" still pops up for a moment, but then disappears again.
I met this error building qt project in Qt Creator. then solved by adding some paths to my system path, which not included them before.
C:\Windows\System32
C:\Windows
C:\Windows\System32\Wbem
Then reopen Qt Creator.
I faced the same problem as you. I use Visual Studio 2017 Community Edition with Qt 5.6.0. Windows 10.
In the beginning, I used "Visual Studio Installer" to repair. However it does not work.
Then I append "C:\Windows\System32" to "PATH" variable to Environment variables" since chcp is a exe in System3 and somehow I cannot find "C:\Windows\System32" in "PATH".
After that, I delete the Visual Studio (C:\Program Files (x86)\Microsoft Visual Studio) directly from File Explorer. ( I shift+deleted it )
Then re-install the "Visual Studio 2017" again.
It works!
I do not know which step is important. I think to add System32 to PATH variable and re-install VS2017 may the solution
In my case, I found the problem in my System Path variable. If the Path contains double quote anywhere, Qt emits this error.
I have meet the "error: Failed to retrieve MSVC Environment" for no reason. I deleated the debug file of my project and it does work.

How to install SignTool.exe for VS 2017?

After upgrade to VS 2017 i got
"Error An error occurred while signing: SignTool.exe not found."
But only using MSbuild on the Visual Studio publish there's no problem.
I already checked folder
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin"
and in fact there's no SignTool.exe present.
But there was before installing VS2017, any ideas?
I followed this issue but no luck
How to install SignTool.exe for Windows 10
Signtool is included with the Windows 10 SDK
Open Visual Studio installer.
Switch to the "Individual Components" tab
Choose the version of the SDK that suits your needs.
Multiple copies may be installed.
Start Developer Command Prompt for VS 2017 then it is in the path variable
signtool
That seems to do the trick, now the problem is with setup.bin file.
error MSB3147: Could not find required file 'setup.bin' in csproj folder
C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool>
This is where its there in my System.
The all solutions didn't worked for me ; finally i just copied signtool.exe to the project folder and then worked. You can download the signtool.exe from internet or install Windows 10 SDK by visual studio installer and then copy from "C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool".
I found it under C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin
It could be because it was there before the vs2017 installation.
It doesn't harm to check :)
So the problem I had with this was that the path variable wasn't set up. I ran
set PATH="C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool";%PATH%
in the Developer Command window before trying to sign anything.
If you do it this way you will need to run the set path every time you want to use it unless you add it to the path environment variable.
I hope this helps.

Visual Studio 2012 - Required file "tracker.exe" is missing

I tried to compile the source code of cryengine 3 and I always get the following error message.
Error 1 error : Required file "tracker.exe" is missing. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets 251 6 CryGame
For some reason I couldn't find any information on google.
Could it be possible that my Visual Studio installtion is somehow corrupt? I am still using the release candidate
A quote from MS website about tracker.exe:
Tracker.exe is required to correctly incrementally generate resources
in some circumstances, such as when building on a 64-bit OS using
32-bit MSBuild. This build requires Tracker.exe, but it could not be
found. The task is looking for Tracker.exe beneath the
InstallationFolder value of the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A.
Possible solutions:
Install the Microsoft Windows SDK v7.0A or later.
Manually set the above registry key to the correct location.
You short-circuit that lookup instead by setting the
ResGenTrackerSdkPath property to the 7.1 .NET 4.0 tools location. In
the build definition, under "MSbuild Arguments", you can add the
following:
/p:ResGenTrackerSdkPath=":\Program Files(x86)\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools
EDIT: your path may differ a little, but this still shows the general path to add
You can go to the directory "C:\Program Files (x86)\Microsoft SDKs\Windows".
Then, you search for the key "tracker.exe", if you can't find it, it might been deleted somehow.
The best way is:
Copy the folder "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools"
To your PC at the same directory.
If it didn't work, you can copy the folder into them[the following picture] every one.
picture: