cmake在Windows XP中不工作 [英] cmake doesn't work in windows XP

查看:169
本文介绍了cmake在Windows XP中不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的 cmake ,只是安装它,并按照本文:

I'm new with cmake,just installed it and following this article:

http://www.cs.swarthmore.edu/~adanner/tips/cmake.php

D:\Works\c\cmake\build>cmake ..
-- Building for: NMake Makefiles
CMake Warning at CMakeLists.txt:2 (project):
  To use the NMake generator, cmake must be run from a shell that can use the
  compiler cl from the command line.  This environment does not contain
  INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
  work.


-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Warning at D:/Tools/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-cl.cmake:32 (ENABLE_LANGUAGE):
  To use the NMake generator, cmake must be run from a shell that can use the
  compiler cl from the command line.  This environment does not contain
  INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
  work.
Call Stack (most recent call first):
  D:/Tools/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:58 (INCLUDE)
  CMakeLists.txt:2 (project)


CMake Error: your RC compiler: "CMAKE_RC_COMPILER-NOTFOUND" was not found.   Please set CMAKE_RC_COMPILER to a valid compiler path or name.
-- Check for CL compiler version
-- Check for CL compiler version - failed
-- Check if this is a free VC compiler
-- Check if this is a free VC compiler - yes
-- Using FREE VC TOOLS, NO DEBUG available
-- Check for working C compiler: cl
CMake Warning at CMakeLists.txt:2 (PROJECT):
  To use the NMake generator, cmake must be run from a shell that can use the
  compiler cl from the command line.  This environment does not contain
  INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
  work.


CMake Warning at D:/Tools/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-cl.cmake:32 (ENABLE_LANGUAGE):
  To use the NMake generator, cmake must be run from a shell that can use the
  compiler cl from the command line.  This environment does not contain
  INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
  work.
Call Stack (most recent call first):
  D:/Tools/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:58 (INCLUDE)
  CMakeLists.txt:2 (PROJECT)


CMake Error at D:/Tools/CMake 2.8/share/cmake-2.8/Modules/CMakeRCInformation.cmake:22 (GET_FILENAME_COMPONENT):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  D:/Tools/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-cl.cmake:32 (ENABLE_LANGUAGE)
  D:/Tools/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:58 (INCLUDE)
  CMakeLists.txt:2 (PROJECT)


CMake Error: CMAKE_RC_COMPILER not set, after EnableLanguage
CMake Error: your C compiler: "cl" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working C compiler: cl -- broken
CMake Error at D:/Tools/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "cl" is not able to compile a simple test program.

  It fails with the following output:





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


CMake Error: your C compiler: "cl" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "cl" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Configuring incomplete, errors occurred!

使用 cmake 成功在Windows XP?我已经安装Visual Studio下 D:\Tools\Microsoft Visual Studio 9.0

What are the complete requirement to use cmake successfully in windows XP?I've already installed Visual Studio under D:\Tools\Microsoft Visual Studio 9.0

推荐答案

首先,我必须承认我不知道 cmake

First of all, I have to confess that I don't know cmake.


要使用NMake生成器,cmake
必须从shell中运行,可以使用
编译器cl从命令
行。这个环境不
包含INCLUDE,LIB或LIBPATH,
,这些必须设置为cl
编译器工作。

To use the NMake generator, cmake must be run from a shell that can use the compiler cl from the command line. This environment does not contain INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to work.

上述错误表示cmake无法找到C / C ++编译器头文件和库的正确位置。

The error above means that the proper locations to your C/C++ compiler's headers and libraries could not be found by cmake.

不要从命令提示符运行cmake,请尝试从 Visual Studio 2008命令提示符运行cmake。您可以在文件夹* Microsoft Visual Studio 9.0 \VC *中的开始>程序> Microsoft Visual Studio 2008> Visual Studio工具 vcvarsall.bat 可视化Studio 2008命令提示符应该为您自动设置所有这些环境变量,以便cmake知道在哪里找到所需的文件。

Instead of running cmake from the Command Prompt, try running cmake from the Visual Studio 2008 Command Prompt. You can find it under Start > Programs > Microsoft Visual Studio 2008 > Visual Studio Tools) or vcvarsall.bat in the folder *Microsoft Visual Studio 9.0\VC*. The visual Studio 2008 Command Prompt should set all these environment variables for you automatically so that cmake knows where to find the necessary files that it needs.

命令提示符将从您的Visual Studio文件夹,因此您必须键入以下命令切换到您的源文件夹并启动cmake。

The Command Prompt will start in your Visual Studio folder, so you'll have to type the following commands to switch to your source folder and start cmake.

D:
cd D:\Works\c\cmake\build>
cmake

我希望这可以帮助你。

这篇关于cmake在Windows XP中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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