windows – Qt Creator使用MinGW编译器和CMake
我正在尝试将Qt Creator用于不使用Qt库的C CMake项目.
我正在关注official guide,但它根本不起作用.这是我的步骤: >将我的MinGW bin目录添加到PATH. 你可能已经注意到官方指南中根本没有提到第4步.我已经习惯了CMake,因此我问自己: 为什么Qt Creator不能提供正常的“MinGW Makefiles”生成器? 最后是最终的问题: 如何让Qt Creator通过CMake使用MinGW编译器? 回答的问题: 根据官方指南,正常情况下,正确设置PATH时,不应该执行步骤5. 为什么CMake没有在PATH中找到编译器集? Ninja Generator会产生这些错误,如果你用CMake手动完成同样的事情就会发生. 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! 查看配置菜单以查看我是否忘记设置某些内容,我偶然发现了编译器设置页面.我当然也在那里添加了我的编译器,但它没有做任何事情. 为什么CMake在使用CMake时不使用编译器列表? 它确实使用了编译器列表,如果您在套件选择中选择了正确的编译器. 解决方法
通常情况下,如果你在弄清楚之后不久就寻求帮助,我现在觉得很愚蠢……
使用CMake时,为什么Qt Creator不使用编译器列表? 它确实如此,但只有在您将Kit设置为使用正确的编译器时! 为什么CMake没有在PATH中找到编译器集? 这实际上是带有CMake的Ninja Generator的问题.如果你直接使用CMake,会发生同样的事情. 为什么Qt Creator不能提供正常的“MinGW Makefiles”生成器? 它确实如此,但前提是您在套件中选择了MinGW编译器! 如何让Qt Creator通过CMake使用MinGW编译器? 通过正确设置一切,而不是过分依赖官方指南. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- Microsoft Media Foundation官方文档翻译(9、10)《Media
- windows-xp – 如何在CMD.exe中创建符号(硬链接)
- 从R调用CUDA编译的.dll
- windows – 具有Splatting错误的新ADUser
- winforms – .NET ListView和Windows 7
- Windows 多线程编程入门(1)
- Windows API一日一练 57 CopyFile和MoveFile函数
- 在Windows Server 2008上设置Mercurial时出错
- 在Windows Azure中部署WebApi的位置:作为网站还是作为云服
- windows – Powershell配色方案?