Tag Archives: LINK : fatal error LNK1158:

Error link: fatal error lnk1158: unable to run ‘RC. Exe’

Open source software supply chain lighting plan, waiting for you>>>

Problem software environment: Windows 10 PRO + Visual Studio 2015, and then installed the windows 10 SDK. Windows 10 SDK is installed with this ISO file: 17134.12.180419-0858.rs4_ release_ svc_ prod2_ WindowsSDK.iso

In the visual c + + project, I switch the target platform from 8.1 to 10.0.17134.0

Then I found that the C + + project, which was compiled normally, was compiled incorrectly. In link, the following error occurred:

1>—— Build started: Project: PHM-Hnode-Std-GuiLauncher, Configuration: Debug x64 —— 1> MainFrameBaseClass.cpp 1> MainFrame.cpp 1> main.cpp 1> Generating Code… 1> LINK : fatal error LNK1158: cannot run ‘rc.exe’ ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Since it was normal to compile when the target platform version was set to 8.1, I wonder if this rc.exe exists in the 8.1 version of the SDK, but is omitted in the 10.0.17134.0 version of the SDK

Sure enough, rc.exe was found in version 8.1 SDK, and at the same time, rcdll.dll was also found

Contents:

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

The directory structure of windows 10 SDK is different from that of windows 8.1 SDK

It is found that rc.exe and rcdll.dll exist in the directory of 10.0.17134.0

Therefore, rc.exe and rcdll.dll files are not missing, but the connector did not find them when compiling

To solve this problem, I don’t know how to let linker find these two files and find the correct version. So I put

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

Copy rc.exe and rcdll.dll in this directory to my VC/bin directory of Visual C +:

D:\Apps\x86\Microsoft\Visual_ Studio\v14.0\VC\bin

Note that the installation directory of my visual c + + may be different from yours. You need to use your own VC/bin directory

Then compile the program, and the error is solved

1>—— Rebuild All started: Project: PHM-Hnode-Std-GuiLauncher, Configuration: Debug x64 —— 1> MainFrameBaseClass.cpp 1> MainFrame.cpp 1> main.cpp 1> Generating Code… 1> PHM-Hnode-Std-GuiLauncher.vcxproj -> D:\DevSpace\Gitpub\phm-prototype-180601\Dev\Build\MSVC_ 2015\Win32\Output\x64\Debug\PHM-Hnode-Std-GuiLauncher.exe 1> PHM-Hnode-Std-GuiLauncher.vcxproj -> D:\DevSpace\Gitpub\phm-prototype-180601\Dev\Build\MSVC_ 2015\Win32\Output\x64\Debug\PHM-Hnode-Std-GuiLauncher.pdb (Partial PDB) ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========