2010-04-25 9 views
8

Soy nuevo con cmake, acaba de instalar y después de este artículo:cmake no funciona en Windows XP

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! 

¿Cuáles son los requisitos para usar completa cmake correctamente en Windows XP ? Ya instalé Visual Studio en D:\Tools\Microsoft Visual Studio 9.0

+0

Afortunadamente, ahora hay mejores opciones para compilar lenguajes DSL para .NET, como una biblioteca llamada FAKE. –

Respuesta

8

Antes que nada, tengo que confesar que no sé cmake.

Para utilizar el generador nmake, cmake debe ejecutarse desde una cáscara que pueden utilizar los cl compilador del línea de comandos. Este entorno no contiene contiene INCLUDE, LIB o LIBPATH, y estos deben configurarse para que el compilador cl funcione.

El error anterior significa que cmake no pudo encontrar las ubicaciones correctas de las librerías y las librerías del compilador de C/C++.

En lugar de ejecutar cmake desde el símbolo del sistema, intente ejecutar cmake desde Visual Studio 2008 Command Prompt. Puede encontrarlo en Inicio> Programas> Microsoft Visual Studio 2008> Herramientas de Visual Studio) o vcvarsall.bat en la carpeta * Microsoft Visual Studio 9.0 \ VC *. El Visual 2008 Command Prompt debe establecer automáticamente todas estas variables de entorno para que cmake sepa dónde encontrar los archivos necesarios que necesita.

El símbolo del sistema se iniciará en su carpeta de Visual Studio, por lo que tendrá que escribir los siguientes comandos para cambiar a su carpeta de origen e iniciar cmake.

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

Espero que esto te ayude.

+0

También me gustaría actualizar y agregar que esto funcionó para VC 2010 – crockpotveggies

0

Tuve problemas similares en Win7 y recibía el mismo error: el compilador de C "cl.exe" no puede compilar un programa de prueba simple.

La solución que funcionó para mí:

  1. En Windows Donot plazo cmake en el terminal cygwin.

  2. Ejecútelo desde el símbolo del sistema, Y también asegúrese de tener derechos de administrador, En Windows 7 puede iniciar el símbolo del sistema como administrador yendo a Inicio-> Todos los programas-> Accesorios-> (Haga clic derecho en Símbolo del sistema) y seleccione "Ejecutar como administrador"

a continuación, ejecute 'cmake <your source>' funcionó como un encanto para mí.

Cuestiones relacionadas