UFO ET IT

VS 2015 명령 프롬프트에서 rc.exe를 더 이상 찾을 수 없습니다.

ufoet 2020. 11. 20. 17:25
반응형

VS 2015 명령 프롬프트에서 rc.exe를 더 이상 찾을 수 없습니다.


방금 Windows 10 Creators Update (버전 10.0.15063)를 설치했습니다.

여러 버전의 Visual Studio가 설치되어 있습니다 (2012, 2013, 2015 및 2017). 몇 주 전에 VS 2017을 설치했습니다.

문제

CMake (버전 3.8.1)는 더 이상 발견하지 않는 C / C ++ 컴파일러는 "프롬프트 VS2015 64 기본 명령"(이 안에 실행할 때 수행 프롬프트 VS 2017 명령 내에서 실행할 때 제대로 일을).

생식

내용 CMakeLists.txt:

project (test)
add_executable (test test.cpp)

(의 내용 test.cpp은 관련이 없습니다.)

VS2015 x64 기본 명령 프롬프트에서 CMake 호출 :

> mkdir build
> cd build
> cmake -G "Visual Studio 14 2015 Win64" ..

CMake 출력 :

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:1 (project):
  No CMAKE_C_COMPILER could be found.

CMake Error at CMakeLists.txt:1 (project):
  No CMAKE_CXX_COMPILER could be found.

-- Configuring incomplete, errors occurred!
See also "D:/dev/cmaketest/build/CMakeFiles/CMakeOutput.log".
See also "D:/dev/cmaketest/build/CMakeFiles/CMakeError.log".

분석

실패의 원인은 다음을 보면 분명합니다 CMakeFiles/CMakeError.log.

ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /nologo /W0 /WX- /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc140.pdb" /Gd /TC /errorReport:queue CMakeCCompilerId.c
  CMakeCCompilerId.c
Link:
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdC.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdC.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdC.lib" /MACHINE:X64 Debug\CMakeCCompilerId.obj
LINK : fatal error LNK1158: cannot run 'rc.exe' [D:\dev\cmaketest\build\CMakeFiles\3.8.1\CompilerIdC\CompilerIdC.vcxproj]

rc.exe(리소스 컴파일러)를 찾을 수 없습니다. 실제로 동일한 VS 2015 명령 프롬프트에서 :

> where rc.exe
INFO: Could not find files for the given pattern(s).

그것은 동안 됩니다 VS 2013 명령 프롬프트에서 발견 :

> where rc.exe
C:\Program Files (x86)\Windows Kits\8.1\bin\x64\rc.exe
C:\Program Files (x86)\Windows Kits\8.1\bin\x86\rc.exe

및 VS 2017 명령 프롬프트 :

> where rc.exe
C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64\rc.exe

PATH다양한 VS 명령 프롬프트에서 환경 변수 의 내용 확인 :

  • VS 2013 명령 프롬프트 내부 PATH에는

    C:\Program Files (x86)\Windows Kits\8.1\bin\x64
    
  • VS 2017 명령 프롬프트 내부 PATH에는

    C:\Program Files (x86)\Windows Kits\10\bin\x64
    C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64
    
  • 그러나 VS 2015 명령 프롬프트 내부 PATH에는

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

    포함하지 않는 rc.exe.

질문

  1. 이것은 알려진 문제입니까 아니면 내 시스템에 특정한 문제입니까?

  2. Windows 10 Creators Update가이 문제를 유발할 수있는 시스템 (예 : Windows SDK 관련 항목)에서 무엇을 설치, 제거 또는 변경할 수 있습니까?

  3. 이 문제를 해결하는 깨끗한 방법은 무엇입니까?

편집 : 설치된 VS 2017 구성 요소 :

VS 2017 구성 요소 설치


Spent some time looking at this on three machines with Win10 Creators Edition and VS2010, VS2013, VS2015 and VS2017 installed, where it works on two machines and fails on the third. All had VS2015 Update 3 and all should have been installed with the same options.

Running the following batch file

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat

should setup the correct environment for VS2015 x64 environment. This should add

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

to the PATH. This is where rc.exe should be. However on my failing machine rc.exe was missing from here, but it did exist in

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

I went back and feeling like this was a setup issue I re-ran the VS2015 Update 3 setup and told it to add

Windows and Web Development -> Universal Windows App Development Tools -> Tools (1.4.1) and Windows 10 SDK (10.0.14393)

this caused rc.exe and related files to appear in

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

Running rc -v on

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

and

C:\Program Files (x86)\Windows Kits\10\bin\x64\rc.exe

gave the same version number 10.0.10011.16384

Not sure why rc.exe was missing from the original install, but re-running the install and adding the other SDK fixed it for me. It looks like

C:\Program Files (x86)\Windows Kits\10\bin\x64\rc.exe

should be the default rc.exe but it was not setup by a previous install.


It's definitely not just you. I installed VS2017 yesterday and doing so seems to have produced the same problem on my end. I don't have a good solution (this should be reported to Microsoft as a bug) but I do have a hacky workaround.

I was able to copy rc.exe and rc.dll from

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

That resolved the issue for me. My hunch is that it's a registry key being overwritten but I haven't dug into it enough to be sure.


Met the same problem with Windows 10 15063.608 (Windows SDK 10.0.15063.0). The solution working for me is the hard links creation for Windows 10 kit binaries x64 and x86 folders like shown below (use the command prompt with admin rights):

mklink /J "C:\Program Files (x86)\Windows Kits\10\bin\x86" "C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86"

mklink /J "C:\Program Files (x86)\Windows Kits\10\bin\x64" "C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64"

(prior to running these commands just rename existing Windows Kits\10\bin\x64 and Windows Kits\10\bin\x86 folders - it looks like they are not in use.


For whatever reason the built-in Tools (1.4.1) and Windows 10 SDK (10.0.14393) installer didn't work for me:

  1. C:\Program Files (x86)\Windows Kits\10\bin\x86 got populated mid-install (success!)
  2. ...then de-populated (sorrow!)
  3. And eventually the installer returned error -2147023293/0x80048646.

The "Windows 10 SDK (ver. 10.0.14393.795)" installer from the Windows SDK and emulator archive worked though: C:\Program Files (x86)\Windows Kits\10\bin\x86 gets and stays populated, including rc.exe.

Windows 7 x64, Visual Studio Professional 2015 Update 3.


Specifying CMAKE_SYSTEM_VERSION=8.1 solved the problem for me.


Similar problem with VS2017 Community 15.4.5 with Windows Sdk version 10.0.16299.0, but only for builds via TeamCity; builds from within VS work fine and so does building with MSBuild when starting from a VS developer command prompt. So this does not exactly answer the OP's question, but is so similar and this is one of the first search matches so I'll add it here.

Found a solution which does not require modifying the installation in any way (no linking/copying so less error-prone and easy to automate):

set the VisualStudioVersion environment variable to 15.0.

You could do this globally using the standard Windows gui for that (example for windows 10 here) but I'd rather strongly advise against it becaus it could interfere with other versions of VS, moreover it is not a change which is easily automated nor checked in into your build code and hence harder to reproduce omn different machines. A better alternative is to set this in the commandline where the build runs (cmd: set VisualStudioVersion=15.0 PS: $env:VisualStudioVersion = '15.0' in TeamCity: add env.VisualStudioVersion Parameter). Another alternative is to pass this directory to MSBuild as a property (pass /p:VisualStudioVersion=15.0 or in teamCity add system.VisualStudioVersion).


  1. run your online installer vs_community2017.exe.
  2. select modify your VS2017
  3. select desktop development with C++
  4. select Windows 10 SDK(my version is 10.0.10586) and install it

Run VS2015 command prompt:

> where rc
> C:\Program Files (x86)\Windows Kits\10\bin\x64\rc.exe
> C:\Program Files (x86)\Windows Kits\10\bin\x86\rc.exe

It seems that vs2017 default installs the newest SDK, and Overwrite old versions.


For anyone who gets stuck on this, one particular problem set is:

  1. get a new windows 10 PC
  2. install VS 2017 [*]
  3. uninstall VS 2017 and
  4. install VS 2015

If you do the above,

it seems that there is a bug or other behavior with the overall suite of Windows/VS installers.

There are basically it seems four problems MSFT have to fix (a) sometimes it just doesn't install rc.exe, (b) it doesn't install rc.exe if you "only" ask for the c++ stuff, you must ask for everything (c) the uninstall-install pipeline seems to be all messed up in various ways (d) even if it randomly installs rc.exe for you, it forgets or fouls-up the path.

:/

Long tedious story short, solutions seem to include one or more of

  1. basically install or re-install 10.0.10011.16384 (but only that one, NOT the two later ones)
  2. look around and see if rc.exe is plain, outright, not there. If so, install it (somewhere, anywhere)
  3. in VS, you'd think you can install "just" the c++ stuff, but no. In practice you MUST check yes to all the web, blah blah development stuff. This seems to give you "more hope" of getting rc.exe. After doing this, revisit point 2, as you may well still not have it.
  4. After doing 2 then 3 and likely 2 again, you likely STILL will not have it in your actual path. I would love to know which is the "best, natural" place to have it in your path, but that seems to be a lost cause. Just shove it in your path somewhere, anywhere.
  5. Create a simple cmake file somewhere - and test it works.

. . . . . .

[*] it may well come with VS 2017, and don't forget VS 2017 may annoyingly get installed with something else, Unity etc.


Open "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" in a text editor in administrator mode and change the line

@if not "%WindowsSdkDir%" == "" @set PATH=%WindowsSdkDir%bin\x86;%PATH%

to

@if not "%WindowsSdkDir%" == "" @set PATH=%WindowsSdkDir%bin\x86;%WindowsSdkDir%bin\%WindowsSDKVersion%x86;%PATH%


I had the exact same problem. Multiple Visual studio versions, including 2015 and 2017. My solution was to run the cmake command from 2017 developer command prompt, and specify the 2015 visual studio version with:

cmake -G "Visual Studio 14 2015" ..


execute following command on native 64/86 visual studio command prompt to set correct version For vs2015 -- %comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 8.1 %comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 8.1

execute following command on native 64/86 visual studio command promptto set correct version For vs2013 - %comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64 7.1 %comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86 7.1

This will set correct path and execute without any issue. I have tested this on WIN10 with VS2013,VS2015,VS2017 installed.

참고 URL : https://stackoverflow.com/questions/43847542/rc-exe-no-longer-found-in-vs-2015-command-prompt

반응형