Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/163.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ CMake-visual studio 2008出现致命错误_C++_Visual Studio_Cmake - Fatal编程技术网

C++ CMake-visual studio 2008出现致命错误

C++ CMake-visual studio 2008出现致命错误,c++,visual-studio,cmake,C++,Visual Studio,Cmake,使用cmake gui配置时,我收到一个cmake错误: The C compiler "C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/cl.exe" is not able to compile a simple test program. It fails with the following output: Change Dir: C:/Users/admin/Desktop/myproject/CMa

使用cmake gui配置时,我收到一个cmake错误:

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

  It fails with the following output:

   Change Dir: C:/Users/admin/Desktop/myproject/CMakeFiles/CMakeTmp



  Run Build Command:c:\PROGRA~2\MICROS~1.0\Common7\IDE\devenv.com
  CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec



  Microsoft (R) Visual Studio Version 9.0.21022.8.

  Copyright (C) Microsoft Corp.  All rights reserved.

  1>------ Build started: Project: cmTryCompileExec, Configuration:
  Debug Win32 ------

  1>Compiling...

  1>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for
  80x86

  1>Copyright (C) Microsoft Corporation.  All rights reserved.

  1>cl /D "CMAKE_INTDIR=\"Debug\"" /D "_MBCS" /FD /MT
  /Fo"cmTryCompileExec.dir\Debug\\"
  /Fd"C:\Users\admin\Desktop\myproject\CMakeFiles\CMakeTmp\Debug/cmTryCompileExec.pdb"
  /c /TC .\testCCompiler.c

  1>testCCompiler.c

  1>Linking...

  1>LINK : fatal error LNK1104: cannot open file 'kernel32.lib'

  1>Build log was saved at
  "file://C:\Users\admin\Desktop\myproject\CMakeFiles\CMakeTmp\cmTryCompileExec.dir\Debug\BuildLog.htm"


  1>cmTryCompileExec - 1 error(s), 0 warning(s)

  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
  ==========

为什么cmake不能让vs编译器找到它需要的库?

我在安装visual studio 2008时遇到了一个rc.exe not found错误。解决了,解决了上面的问题


很抱歉打扰您。

可能编译器变量设置不正确,请尝试使用“Visual Studio命令提示符”。