关于 CMake“cmake is not able to compile a simple test program”错误 的解决方法

简介: 关于 CMake“cmake is not able to compile a simple test program”错误 的解决方法

问题

  经常弄编译,CMake可视化界面配置一些CMake工程的时候,主要是windows下的mingw32版本的,经常会出现c和cxx编译器过不去的情况,其实路径都没有问题,尝试多种方法并且解决了,如重装系统,换cmake版本,但是不可能遇到每次都换。


原理

  其实检查编译器这个步骤我们可以判断是没问题的,所以直接在检测C和CXX两个脚本上去掉这2个检查即可。


修改文件

两个文件所在文件夹:C:\CMake\share\cmake-3.10\Modules

C检查脚本路径:CMakeTestCCompiler.cmake

CXX检查脚本路径:CMakeTestCXXCompiler.cmake


测试通过


相关文章
|
7月前
|
人工智能 机器人 测试技术
【CMake报错】Cannot specify compile definitions for target “PRIVATE“ which is not built...
【CMake报错】Cannot specify compile definitions for target “PRIVATE“ which is not built...
|
7月前
MTK在编译10A的target时报错:make: *** [mmi_feature_check]
MTK在编译10A的target时报错:make: *** [mmi_feature_check]
32 0
|
7月前
|
编译器 Linux C语言
CMake指定交叉编译指南:从编译器设置到验证 (CMake Cross-compilation Guide: From Compiler Setup to Verification)
CMake指定交叉编译指南:从编译器设置到验证 (CMake Cross-compilation Guide: From Compiler Setup to Verification)
1947 1
|
7月前
解决运行qmake:Project ERROR: Cannot run compiler ‘cl‘. Output:
解决运行qmake:Project ERROR: Cannot run compiler ‘cl‘. Output:
724 0
关于 CMake编译出出现错误“Could not find compiler set in environment variable RC:” 的解决方法
关于 CMake编译出出现错误“Could not find compiler set in environment variable RC:” 的解决方法
关于 CMake编译出出现错误“Could not find compiler set in environment variable RC:” 的解决方法
|
机器人 Linux 编译器
替代notepad++,notepad--介绍及插件cmake编译
替代notepad++,notepad--介绍及插件cmake编译
【解决方案】成功解决ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects报错信息
成功解决ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects报错信息
【解决方案】成功解决ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects报错信息
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
739 0
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
编译OpenJDK11:configure: error: Target CPU mismatch. We are building for x86_64 but CL is for “版“; exp
编译OpenJDK11:configure: error: Target CPU mismatch. We are building for x86_64 but CL is for “版“; exp
174 0
|
编译器 C语言
CodeBlocks出现Can‘t find compiler executable in your search path for GNU GCC Compier错误
CodeBlocks出现Can‘t find compiler executable in your search path for GNU GCC Compier错误
479 0
CodeBlocks出现Can‘t find compiler executable in your search path for GNU GCC Compier错误