2013-01-14 36 views
6

Tôi đang cố gắng để CMAKE tạo một dự án cho phiên bản msvc 10 express cho kiến ​​trúc x64. Tôi đã cài đặt cả MSVC 2010 Express và Windows SDK 7.1.Cmake không thể định cấu hình dự án cho Visual Studio 10 amd64

Nếu tôi khởi động CMake Bình thường, tôi có thể tạo dự án 32 bit, tuy nhiên không thể tạo dự án 64 bit. Tôi cũng đã thử bắt đầu từ CMAKE trong Windows Command Command Prompt (cl cmd bản đồ để phiên bản x64) Tuy nhiên nó vẫn không thành công với những điều sau đây.

Found Windows SDK v7.1: C:\Program Files\Microsoft SDKs\Windows\v7.1\ 
Check for working C compiler using: Visual Studio 10 Win64 
Check for working C compiler using: Visual Studio 10 Win64 -- broken 
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE): 
    The C compiler "c:/Program Files (x86)/Microsoft Visual Studio 
    10.0/VC/bin/amd64/cl.exe" is not able to compile a simple test program. 

    It fails with the following output: 

    Change Dir: C:/Users/Dan/Desktop/pclt/PCL/bin/CMakeFiles/CMakeTmp 



    Run Build Command:C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe 
    cmTryCompileExec1400574213.vcxproj /p:Configuration=Debug 

    Microsoft (R) Build Engine Version 4.0.30319.1 

    [Microsoft .NET Framework, Version 4.0.30319.296] 

    Copyright (C) Microsoft Corporation 2007. All rights reserved. 



    Build started 1/14/2013 8:15:59 AM. 

    Project 
    "C:\Users\Dan\Desktop\pclt\PCL\bin\CMakeFiles\CMakeTmp\cmTryCompileExec1400574213.vcxproj" 
    on node 1 (default targets). 

    PrepareForBuild: 

    Creating directory "cmTryCompileExec1400574213.dir\Debug\". 
    Creating directory "C:\Users\Dan\Desktop\pclt\PCL\bin\CMakeFiles\CMakeTmp\Debug\". 

    InitializeBuildStatus: 

    Creating "cmTryCompileExec1400574213.dir\Debug\cmTryCompileExec1400574213.unsuccessfulbuild" because "AlwaysCreate" was specified. 

    ClCompile: 

    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\CL.exe /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec1400574213.dir\Debug\\" /Fd"C:/Users/Dan/Desktop/pclt/PCL/bin/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec1400574213.pdb" /Gd /TC /errorReport:queue C:\Users\Dan\Desktop\pclt\PCL\bin\CMakeFiles\CMakeTmp\testCCompiler.c /Zm1000 /GZ 

    C:\Program Files 
    (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(146,5): 
    error : Required file "" is missing. 
    [C:\Users\Dan\Desktop\pclt\PCL\bin\CMakeFiles\CMakeTmp\cmTryCompileExec1400574213.vcxproj] 


    Done Building Project 
    "C:\Users\Dan\Desktop\pclt\PCL\bin\CMakeFiles\CMakeTmp\cmTryCompileExec1400574213.vcxproj" 
    (default targets) -- FAILED. 



    Build FAILED. 




    "C:\Users\Dan\Desktop\pclt\PCL\bin\CMakeFiles\CMakeTmp\cmTryCompileExec1400574213.vcxproj" 
    (default target) (1) -> 

    (ClCompile target) -> 

    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(146,5): error : Required file "" is missing. [C:\Users\Dan\Desktop\pclt\PCL\bin\CMakeFiles\CMakeTmp\cmTryCompileExec1400574213.vcxproj] 



     0 Warning(s) 
     1 Error(s) 



    Time Elapsed 00:00:00.12 





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


Configuring incomplete, errors occurred! 

Trả lời

1

Tôi gặp sự cố tương tự trên Win7 và gặp phải lỗi tương tự - Trình biên dịch C "cl.exe" không thể biên dịch chương trình thử nghiệm đơn giản.

Các giải pháp mà làm việc cho tôi:

  1. Trên Windows donot chạy cmake trên nhà ga Cygwin.
  2. Chạy nó từ dấu nhắc lệnh, VÀ cũng đảm bảo rằng bạn có quyền quản trị, Trong cửa sổ 7, bạn có thể bắt đầu nhắc lệnh với tư cách quản trị viên bằng cách truy cập Bắt đầu-> Tất cả chương trình-> Phụ kiện-> (Nhấp chuột phải vào Dấu nhắc Lệnh) và chọn "Chạy với tư cách quản trị viên"

Sau đó chạy cmake <your source> Làm việc như một sự quyến rũ đối với tôi.

Các vấn đề liên quan