Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows Qt创建者使用带有CMake的MinGW编译器 我试图用Qt Creator来代替C++的QuaT项目,不使用Qt库。_Windows_Cmake_Mingw_Qt Creator - Fatal编程技术网

Windows Qt创建者使用带有CMake的MinGW编译器 我试图用Qt Creator来代替C++的QuaT项目,不使用Qt库。

Windows Qt创建者使用带有CMake的MinGW编译器 我试图用Qt Creator来代替C++的QuaT项目,不使用Qt库。,windows,cmake,mingw,qt-creator,Windows,Cmake,Mingw,Qt Creator,我正在遵循这条规则,但它根本不起作用。以下是我的步骤: 将我的MinGW bin目录添加到路径 运行QtCreator并安装CMake 打开一个非常基本的CMakeLists.txt文件 选择“忍者(桌面)”作为CMake生成器 从CMake获取错误 您可能已经注意到,官方指南中实际上根本没有提到第4步。我非常习惯于制作CMake,因此我问自己: 为什么Qt创建者不提供普通的“MinGW Makefiles”生成器? 最后一个问题是: 如何让Qt创建者通过CMake使用MinGW编译器? 回

我正在遵循这条规则,但它根本不起作用。以下是我的步骤:

  • 将我的MinGW bin目录添加到
    路径
  • 运行QtCreator并安装CMake
  • 打开一个非常基本的
    CMakeLists.txt
    文件
  • 选择“忍者(桌面)”作为CMake生成器
  • 从CMake获取错误
  • 您可能已经注意到,官方指南中实际上根本没有提到第4步。我非常习惯于制作CMake,因此我问自己:

    为什么Qt创建者不提供普通的“MinGW Makefiles”生成器?

    最后一个问题是:

    如何让Qt创建者通过CMake使用MinGW编译器?


    回答问题:

    根据官方指南,当您正确设置
    路径时,通常不应执行步骤5

    为什么CMake不能在
    路径中找到编译器集?

    是忍者生成器产生了这些错误,如果你用CMake手动执行,同样的事情也会发生

    查看“配置”菜单以查看是否忘记设置某些内容,我无意中看到了编译器设置页面。然后我当然也在那里添加了我的编译器,但它什么也没做

    使用CMake时,为什么CMake不使用编译器列表?

    如果您在kits选项中选择了正确的编译器,它将使用编译器列表


    构建并运行“>

    ,就像通常情况下,如果你只是在发现问题后不久才寻求帮助,我现在觉得很愚蠢

    为什么Qt创建者在使用CMake时不使用编译器列表?

    确实如此,但前提是您将工具包设置为使用正确的编译器

    为什么CMake不能在路径中找到编译器集?

    这实际上是使用CMake的忍者生成器的问题。如果直接使用CMake,同样的情况也会发生

    为什么Qt创建者不提供普通的“MinGW Makefiles”生成器?

    确实如此,但前提是您在工具包中选择了一个MinGW编译器

    如何让Qt创建者通过CMake使用MinGW编译器?

    通过正确设置所有内容,而不是过分依赖官方指南


    您应该添加错误的文本,以便对其进行索引。没有引擎能够对图像中的文本进行索引。这将有助于未来的网站访问者。例如,Google返回0个“错误要求内部CMake变量未设置”“CMake\u CXX\u编译器\u EN\u VAR”的点击率”“谢谢!我将图像切换到文本中的错误。此外,我还解决了其中两个问题,这仍然留下了两个悬而未决的问题。
    CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
    Missing variable is:
    CMAKE_CXX_COMPILER_ENV_VAR
    CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
    Missing variable is:
    CMAKE_CXX_COMPILER
    CMake Error: Could not find cmake module file: D:/Programming/C++/Test/SupportQt/build/CMakeFiles/3.0.2/CMakeCXXCompiler.cmake
    CMake Error at CMakeLists.txt:1 (project):
      No CMAKE_C_COMPILER could be found.
    
      Tell CMake where to find the compiler by setting the CMake cache entry
      CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name
      if it is in the PATH.
    
    
    CMake Error at CMakeLists.txt:1 (project):
      No CMAKE_CXX_COMPILER could be found.
    
      Tell CMake where to find the compiler by setting the CMake cache entry
      CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler
      name if it is in the PATH.
    
    
    CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
    Missing variable is:
    CMAKE_C_COMPILER_ENV_VAR
    CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
    Missing variable is:
    CMAKE_C_COMPILER
    CMake Error: Could not find cmake module file: D:/Programming/C++/Test/SupportQt/build/CMakeFiles/3.0.2/CMakeCCompiler.cmake
    
    CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.-- Configuring incomplete, errors occurred!