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

测试通过

相关文章
|
22天前
|
编译器 Linux C语言
CMake指定交叉编译指南:从编译器设置到验证 (CMake Cross-compilation Guide: From Compiler Setup to Verification)
CMake指定交叉编译指南:从编译器设置到验证 (CMake Cross-compilation Guide: From Compiler Setup to Verification)
45 0
|
编译器 Go 开发工具
常见问题之Golang——cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in %PATH%错误
本文主要是对我日常在使用golang时遇到的一些问题与解决方式进行的汇总,在此提供给大家便于排查一些遇到的问题,其中有更好的解决方案可在评论区留言。
934 0
常见问题之Golang——cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in %PATH%错误
|
2月前
|
Go C语言
安装go-sqlite3包时报exec: "gcc": executable file not found in %PATH%解决办法
安装go-sqlite3包时报exec: "gcc": executable file not found in %PATH%解决办法
|
4月前
解决运行qmake:Project ERROR: Cannot run compiler ‘cl‘. Output:
解决运行qmake:Project ERROR: Cannot run compiler ‘cl‘. Output:
110 0
|
10月前
|
机器人 Linux 编译器
替代notepad++,notepad--介绍及插件cmake编译
替代notepad++,notepad--介绍及插件cmake编译
关于 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:” 的解决方法
|
iOS开发
编译OpenJDK8报错:configure: error: Failed to determine Xcode version.
编译OpenJDK8报错:configure: error: Failed to determine Xcode version.
93 0
编译x264出现错误:No working C compiler found.
编译x264出现错误:No working C compiler found.
256 0
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
456 0
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
|
计算机视觉
OpenCV编译时提示错误“ Built target libprotobuf”
OpenCV编译时提示错误“ Built target libprotobuf”
404 0