日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

c语言编译后找不到exe,在VS 2015命令提示符中找不到c – rc.exe

發(fā)布時間:2023/12/3 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 c语言编译后找不到exe,在VS 2015命令提示符中找不到c – rc.exe 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

我剛剛安裝了Windows 10 Creators Update(版本10.0.15063).

我安裝了多個版本的Visual Studio(2012年,2013年,2015年和2017年).我?guī)字芮安虐惭b了VS 2017.

問題

在“VS2015 x64本機命令提示符”中運行時,CMake(版本3.8.1)不再找到C/C++編譯器(在VS 2017命令提示符下運行時它可以正常工作).

再生產(chǎn)

CMakeLists.txt的內(nèi)容:

project (test)

add_executable (test test.cpp)

(test.cpp的內(nèi)容無關(guān)緊要.)

在VS2015 x64本機命令提示符中進(jìn)行CMake調(diào)用:

> 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

在各種VS命令提示符中檢查PATH環(huán)境變量的內(nèi)容:

>在VS 2013命令提示符內(nèi),PATH包含

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

>在VS 2017命令提示符內(nèi),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.

問題

>這是一個已知問題還是特定于我的系統(tǒng)?

> Windows 10 Creators Update可能會在系統(tǒng)中安裝,卸載或更改(可能是與Windows SDK相關(guān)的東西)會觸發(fā)此問題?

>什么是解決這個問題的干凈方法?

編輯:安裝VS 2017組件:

總結(jié)

以上是生活随笔為你收集整理的c语言编译后找不到exe,在VS 2015命令提示符中找不到c – rc.exe的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。