VS 2010和CMake:'rc'不被识别为内部或外部命令 [英] VS 2010 and CMake: 'rc' is not recognized as an internal or external command

查看:80
本文介绍了VS 2010和CMake:'rc'不被识别为内部或外部命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用VS 2010和CMake在Windows 10-Home上构建项目。
我遇到以下错误:

I'm trying to build a project on Windows 10 - Home using VS 2010 and CMake. I'm getting the following errors:

zutil.c  
lib -nologo -out:zlib.lib adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj  gzwrite.obj infback.obj inflate.obj inftrees.obj inffast.obj trees.obj uncompr.obj zutil.obj   

rc /dWIN32 /r /fozlib1.res ./win32/zlib1.rc   
'rc' is not recognized as an internal or external command,
operable program or batch file.   

NMAKE : fatal error U1077: 'rc' : return code '0x1'
Stop.  
*.dll   
The system cannot find the file specified.
        0 file(s) copied.  

Setting environment for using Microsoft Visual Studio 2010 x86 tools.  
The system cannot find the file specified.  
-- The C compiler identification is MSVC 16.0.40219.1  
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/cl.exe   
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/cl.exe -- broken   

CMake Error at C:/Program Files (x86)/CMake/share/cmake3.6/Modules/CMakeTestCCompiler.cmake:61 (message):


The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
  10.0/VC/bin/cl.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Project/build/libpng-1.6.7-build/CMakeFiles/CMakeTmp

有人知道原因吗?

'rc' is not recognized as an internal or external command,
operable program or batch file."  

会吗?

我假设这也会导致cl.exe损坏错误?

I'm assuming that's also causing the cl.exe is broken error?

推荐答案

我上一次遇到此问题是在Visual Studio 2012 Professional标准安装中没有安装任何Windows SDK时(错误日志显示缺少SDK标头)。

The last time I had this problem was when my Visual Studio 2012 Professional standard installation did not install any Windows SDK (the error log was showing an missing SDK header).

要验证您的SDK安装,例如,检查是否安装了任何Resource Compiler,其路径应类似于:

To verify your SDK installation e.g. check that you have any Resource Compiler installed. It should be in a path similar to:

C:\Program Files (x86)\Microsoft SDKs\Windows\v[some version]\bin\RC.Exe

因为我错过了-或更多整理所有SDK-我安装了 Windows 8.1 SDK (因为Visual Studio 2012确实针对Windows 8.x),瞧瞧,我的CMake再次能够编译(测试)程序。我认为对于Visual Studio 2010,默认值为 Windows 7.0a SDK ,对于Visual Studio 2015,它将为 Windows 10 SDK 通用C运行时

Since I was missing this - or more accurate any SDK - I installed Windows 8.1 SDK (since Visual Studio 2012 does target Windows 8.x) and voila my CMake was able again to compile the (test) programs. I think for Visual Studio 2010 the default would be the Windows 7.0a SDK and for Visual Studio 2015 it would be Windows 10 SDK with Universal C Runtime.

参考

  • The CXX compiler identification is unknown
  • Visual Studio 2010 Express, Windows SDK 7.1, CMake and 64 bit

这篇关于VS 2010和CMake:'rc'不被识别为内部或外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆