2017-07-02 532 views
0

我正在嘗試使用cmake在qt創建者中建立一個構建環境,但無論我嘗試什麼,我都無法獲得進展。它沒有問題; 「配置問題」。在「通用消息」部分展開詳細信息時,看起來它沒有編譯測試c程序。使用Qt Creator時CMake配置問題

我看不出我的qt創建者配置有什麼問題;我必須手動設置qq應用的qmake。這按預期工作。這是配置。

enter image description here

這是中顯示的常規消息完全錯誤;

Running Windows Runtime device detection. 
No winrtrunner.exe found. 
Running "C:\Program Files\CMake\bin\cmake.exe -E server "--pipe=\\.\pipe\{8454d5f3-9c7b-42c8-8f39-a6bfbbbdd562}" --experimental" in 
C:\Users\Andrew\AppData\Local\Temp\QtCreator-l9Mfi9\qtc-cmake-XXUaBP1D. 
The C compiler identification is MSVC 19.0.24215.1 
The CXX compiler identification is MSVC 19.0.24215.1 
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/x86_amd64/cl.exe 
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/x86_amd64/cl.exe -- broken 
CMake Error at C:/Program Files/CMake/share/cmake-3.7/Modules/CMakeTestCCompiler.cmake:51 (message): 
    The C compiler "C:/Program Files (x86)/Microsoft Visual Studio 
    14.0/VC/BIN/x86_amd64/cl.exe" is not able to compile a simple test program. 

    It fails with the following output: 

    Change Dir: C:/Users/Andrew/AppData/Local/Temp/QtCreator-l9Mfi9/qtc-cmake-XXUaBP1D/CMakeFiles/CMakeTmp 



    Run Build Command:"nmake" "/NOLOGO" "cmTC_2c22c\fast" 

    "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f 
    CMakeFiles\cmTC_2c22c.dir\build.make /nologo -L 
    CMakeFiles\cmTC_2c22c.dir\build 

    Building C object CMakeFiles/cmTC_2c22c.dir/testCCompiler.c.obj 

      C:\PROGRA~2\MICROS~1.0\VC\BIN\X86_AM~1\cl.exe 
    @C:\Users\Andrew\AppData\Local\Temp\nm7672.tmp 

    testCCompiler.c 

    Linking C executable cmTC_2c22c.exe 

"C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe 
    --intdir=CMakeFiles\cmTC_2c22c.dir --manifests -- 
    C:\PROGRA~2\MICROS~1.0\VC\bin\X86_AM~1\link.exe /nologo 
    @CMakeFiles\cmTC_2c22c.dir\objects1.rsp 
    @C:\Users\Andrew\AppData\Local\Temp\nm76B2.tmp 

    MT failed to run. 

    NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe"' : 
    return code '0xffffffff' 

    Stop. 

    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 
    14.0\VC\BIN\nmake.exe"' : return code '0x2' 

    Stop. 





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


Configuring incomplete, errors occurred! 
See also "C:/Users/Andrew/AppData/Local/Temp/QtCreator-l9Mfi9/qtc-cmake-XXUaBP1D/CMakeFiles/CMakeOutput.log". 
See also "C:/Users/Andrew/AppData/Local/Temp/QtCreator-l9Mfi9/qtc-cmake-XXUaBP1D/CMakeFiles/CMakeError.log". 

實際的CMake文件的內容似乎並不重要,所以我非常依賴未正確配置的東西。

我試着搞亂了工具鏈無濟於事。有任何想法嗎?

回答

1

我想到最後。

這是我經歷的過程。最初我假定我有一些如何不正確配置編譯器工具鏈,所以要排除我切換到MinGW GNU工具鏈gcc/gdb。

問題依然存在,所以只剩下兩個真正的可能性。 CMake壞了或者CMake Generator沒有正確配置。爲了理智的原因,忽略了發電機的第一個問題。

我試着通過一些提供的選項切換,顯然我沒有安裝它們中的任何一個。但最後有人給了我一個合理的錯誤,Qt Creator找不到它。 (我從nmake轉向忍者)。

我安裝了它,並將它添加到OS PATH環境變量中;所以Qt Creator可以找到它。 (視窗10:控制面板>系統>高級系統設置(邊欄)>環境變量+設爲路徑> OK)

(Linux的:添加導出路徑= 「$ {PATH}」:要像你的.bashrc)。除非您從源代碼安裝該程序,否則可能不會成爲Linux上的問題。

無論如何,這是令人沮喪的。建立一個新的開發環境很糟糕。