2010-04-25 13 views
8

मैं cmake के साथ नए कर रहा हूँ में काम नहीं करता, बस इसे स्थापित किया है और इस लेख निम्नलिखित:cmake विंडोज़ 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! 

क्या पूरा आवश्यकता हैं Windows XP में सफलतापूर्वक cmake उपयोग करने के लिए ? मैंने पहले से ही D:\Tools\Microsoft Visual Studio 9.0

+0

सौभाग्य से FETE नामक लाइब्रेरी की तरह .NET के लिए डीएसएल भाषाओं के निर्माण के लिए बेहतर विकल्प हैं। –

उत्तर

8

के तहत विजुअल स्टूडियो स्थापित कर लिया है, सबसे पहले, मुझे यह स्वीकार करना होगा कि मुझे सेमीके नहीं पता है।

Nmake जनरेटर का उपयोग करने के लिए, cmake एक शेल कमांड लाइन से संकलक सीएल उपयोग कर सकते हैं कि से चलाया जाना चाहिए। यह वातावरण में INCLUDE, LIB, या LIBPATH, शामिल नहीं है और इन्हें काम करने के लिए cl कंपाइलर के लिए सेट किया जाना चाहिए।

उपर्युक्त त्रुटि का अर्थ है कि आपके सी/सी ++ कंपाइलर के शीर्षलेख और पुस्तकालयों के उचित स्थान cmake द्वारा नहीं मिल सके।

कमांड प्रॉम्प्ट से सेमेक चलाने के बजाय, विजुअल स्टूडियो 2008 कमांड प्रॉम्प्ट से सेमेक चलाने का प्रयास करें। फ़ोल्डर * माइक्रोसॉफ्ट विजुअल स्टूडियो 9.0 \ वीसी * में आप स्टार्ट> प्रोग्राम> माइक्रोसॉफ्ट विजुअल स्टूडियो 2008> विजुअल स्टूडियो टूल्स) या vcvarsall.bat के तहत पा सकते हैं। विजुअल स्टूडियो 2008 कमांड प्रॉम्प्ट को आपके लिए इन सभी पर्यावरण चर सेटों को स्वचालित रूप से सेट करना चाहिए ताकि सेमेक को पता चले कि आवश्यक फाइलों को कहां ढूंढना है।

कमांड प्रॉम्प्ट आपके विजुअल स्टूडियो फ़ोल्डर में शुरू होगा, इसलिए आपको अपने स्रोत फ़ोल्डर में स्विच करने और cmake शुरू करने के लिए निम्न आदेश टाइप करना होगा।

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

मुझे आशा है कि यह आपकी मदद करेगा।

+0

मैं भी अपडेट करना और जोड़ना चाहता हूं कि यह वीसी 2010 के लिए काम करता है – crockpotveggies

0

मुझे Win7 पर समान समस्याएं थीं, और एक ही त्रुटि मिल रही थी - सी संकलक "cl.exe" एक साधारण परीक्षण प्रोग्राम संकलित करने में सक्षम नहीं है।

समाधान है कि मेरे लिए काम किया:

  1. विंडोज Donot रन cmake पर cygwin टर्मिनल पर।

  2. इसे कमांड प्रॉम्प्ट से चलाएं, और यह भी सुनिश्चित करें कि आपके पास व्यवस्थापकीय अधिकार हैं, विंडोज 7 में आप स्टार्ट-> सभी प्रोग्राम्स-> सहायक उपकरण-> (कमांड प्रॉम्प्ट पर राइट क्लिक पर जाकर व्यवस्थापक के रूप में कमांड प्रॉम्प्ट प्रारंभ कर सकते हैं) और "व्यवस्थापक के रूप में चलाएं" का चयन करें

फिर 'cmake <your source>' चलाएं मेरे लिए एक आकर्षण की तरह काम किया।