2013-04-30 113 views
1

通過CMake-GUI配置,而我收到的cmake錯誤致命錯誤:CMake的 - 與Visual Studio 2008

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編譯器發現它所需要的庫?

+1

可能編譯器變量設置不正確,請嘗試使用「Visual Studio命令提示符」。 – 2013-04-30 15:52:44

回答

0

我在我的visual studio 2008安裝中找不到rc.exe錯誤。解決了它,解決了上述問題。

很抱歉讓您煩惱。