[Solved] error: link.exe‘ failed with exit status 1158

Error Messages:

bug error: command ‘\XXX\VS2015\VC\BIN\x86_amd64\link.exe‘ failed with exit status 1158



Because some of the previous system configurations are gone, reinstall things such as vs and buildtools, but there are many problems in the installation process, and there are always missing things. Record the contents that are difficult to find here
prompt error when the program is running: error: command ‘\XXX\VS2015\VC\BIN\x86_amd64\link.exe‘ failed with exit status 1158
background display

I read the online solution, that is, vs is missing two files rc.exe and rcdl.dll can’t run, but I can’t find these two files according to the online path
the path of others is:
C:\Program Files(×86)Windows Kits\8.1\bin\×86
I found it in this path
C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64
C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86
both can be used
in short, these two files are rc.exe andrcdl.dll must be in the path of C:\Program Files (x86)\Windows Kits, but the location of different system configurations may be different. This is probably related to some things you installed. Look carefully

then copy the two files to
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64

Or C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
you can solve the problem by installing Microsoft Visual Studio 14.0

Read More: