VS2017: “Cannot find the resource compiler DLL. Please make sure the path is correct.” - visual-c++-2017

I am using Visual Studio 2017. When I try to build a solution, I encounter this error:
Cannot find the resource compiler DLL. Please make sure the path is correct.
I checked my system, and found that the v7.0, v8.0, v8.0A, v8.1A, and v10.0A SDKs are installed on my machine. I checked my project properties, and the default SDK is v8.0

Me too, i have only the "windows 10 sdk version 10.0.15063.0" installed, and solved after:
Copy rddll.dll from:
c:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86\rcdll.dll
to:
c:\Program Files (x86)\Windows Kits\10\bin\x86\
ref link: https://developercommunity.visualstudio.com/content/problem/43024/ide-cannot-find-the-resource-compiler-dll-rcdlldll.html
Just a temporary workaround, but it works.
Edit:
Run Visual Studio Installer from start menu, and click Update, after a while it's done, all thing worked.
it's doesn't need to copy file any more.

you could copy from
C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64\rc.exe
C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64\rcdll.dll
to
C:\Program Files (x86)\Windows Kits\10\bin\x64\rc.exe
C:\Program Files (x86)\Windows Kits\10\bin\x64\rcdll.dll
and copy from
C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86\rc.exe
C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86\rcdll.dll
to
C:\Program Files (x86)\Windows Kits\10\bin\x86\rc.exe
C:\Program Files (x86)\Windows Kits\10\bin\x86\rcdll.dll

The reason is that Visual Studio cannot find the requested files.
You have to (re)install or repair the requested version through Visual Studio Installer.
You can reach that through Visual Studio menu bar -> Tools -> Get Tools and Features -> Individual Components -> find and tick the respective {version} tools to install and then click "Modify".
It should work after that. Best of luck.

you can just simply change the compiler from resource compiler to C / C++ Compiler and you can do that by simply making a resource and you will face that error, after that right click the empty resource that have been generated and on the folder of resources right click the [nameofyourproject].rc and then choose properties and from item type change it to C / C++ Compiler and then delete that resource and create a new one and you will find it works fine with you.

Related

Cannot open file 'pgort.llib' after adding /GENPROFILE flag

I'm trying to follow the instructions here to add PGO for my project. After I added the /GENPROFILE flag, I start getting the link error:
LINK : fatal error LNK1104: cannot open file 'pgort.lib'
After debugging it a bit, I believe the problem is that my Library Directories (found under VC++ Directories tab) has a value of $(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64) which is evaluating to:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\spectre\x64
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\atlmfc\lib\spectre\x64
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\VS\lib\x64
C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\VS\UnitTest\lib
C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\lib\um\x64
It looks like the .\spectre\x64 paths don't have the pgort.lib library, but the non-spectre path does:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64
What do I do to fix this? I find it hard to believe that if I'm using the spectre binaries (which I am not even sure how/why I am in the first place) that I can't optimize my project.
BTW, I tried this on a machine with Enterprise VS installed and it's the same. So this isn't specific to Community edition.
I ended up updating my build configuration/scripts to dynamically update the LibraryPath to add the appropriate, architecture-specific version of $(VC_LibraryPath_VC_x64_Desktop) when compiling for PGO.

fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory

I am referring to C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\ WDK files. Though I have installed latest 10.0.15063.0. It seems some files are missing in 10.0.14393 folder.
Anyone could help me to in this. Reparing Microsoft Visual Studio15 or reparing wdk 10.0.15063 does not help.
Ensure you have installed "Universal CRT" component of your visual studio.
More over for newer versions of Visual studio
in case the directory "C:\Program Files\Windows Kits" exists on your system ensure that it contains "10/Include" and "10/Lib" subdirectories.
If not create hard links there to thoose present in your "C:\Program Files (x86)\Windows Kits\10"
As you can see from C:\Program Files (x86)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\uCRT.props
the path "C:\Program Files\Windows Kits" is prefered over "C:\Program Files (x86)\Windows Kits" if it exists.
In Visual studio go to Project -> Properties -> VC++ Directories -> Include Directories and add:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt
In Project -> Properties -> VC++ Directories -> Library Directories add:
C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64
That's it, your program should now compile without errors!

Where can I find the Windows header files

Sometimes in my research into Microsoft functions, I'll see the name of a constant and perhaps a reference to a header file - like winuser.h. I don't often need to refer to them but when I do, I wind up spending some time Googling to find out where those files are. With this question, I can hopefully come to the answer right away. The question, as the title says, is: Assuming I've installed Visual Studio or the SDK, where in the file directory structure on a windows machine can I find the basic windows header files, like windows.h and winuser.h?
First you need to install Visual Studio or the Windows SDK. I'd give URLs here but they change with every new version of windows. The header files could be in
C:\Program Files\Microsoft SDKs\Windows\vX.X\Include
C:\Program Files (x86)\Microsoft SDKs\Windows\vX.X\Include
(where vX.X reflects the version number)
Update - May 2020
I'm on a new machine and installed VS2019 and the WindowsSDK and here are the new locations:
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Professional\SDK\ScopeCppSDK\vc15\SDK\include\um
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um
I do not see any includes in the 'Program Files' folders.

Why does 'iprtrmib.h' in Window Kits 8.0 reference 'mprapidef.h' in window 'kits 8.1'?

I am using Visual Studio 2012 (Update 5) with MS Window Kits 8.0 and .NET Framework 4.5.51209. Recently, I also installed MS Window Kits 8.1.
Now, I have a file: '\windows kits\8.0\include\shared\iprtrmib.h' that failes to include 'mprapidef.h'.
That include file only exists at: '\Windows Kits\8.1\Include\shared\mprapidef.h', which is not in my include path.
My Visual Studio 'Include Directories' is set to: "$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);".
These are my Visual Studio macros:
VCInstallDir: C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\
WindowsSDK_IncludePath: C:\Program Files (x86)\Windows Kits\8.0\Include\um;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\winrt
When searching, I found a slightly similar question: missing header file on a new installation of visual studio 2012
I tried repairing my Visual Studio installation. I do not want to change the 'Include Directories' for each of my projects. What else should I try?
I installed vs2015 and vs2012, then the same problem occurs,however, I find a solution.
open visual studio project settings,click VC++ Directories, find Include Directories,add the following line to it.
C:\Program Files (x86)\Windows Kits\8.1\Include\shared
One may add the corresponding 8.1 paths to the environment variable.
Maybe it's necessary to do the same thing with the lib environment variable (WindowsSDK_LibraryPath_x86).

VS2012 doesn't include winres.h any more?

After installing VS2012, I can't find winres.h under folder "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC". What happen to VS2012 and why remove this header file?
By the way, in VS2010, winres.h locates in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include"
The file is part of the Windows SDK now and since VS2012 the SDK location is different, it's now called a 'Kit' and is found in Program Files/Windows Kits. Sepcifically you can find winres.h in
C:\Program Files (x86)\Windows Kits\8.0\Include\um

Resources