2017-07-02 97 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上的问题。

无论如何,这是令人沮丧的。建立一个新的开发环境很糟糕。