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

测试通过

相关文章
|
6月前
|
人工智能 机器人 测试技术
【CMake报错】Cannot specify compile definitions for target “PRIVATE“ which is not built...
【CMake报错】Cannot specify compile definitions for target “PRIVATE“ which is not built...
|
6月前
|
Java Maven
Error executing CMake: Cannot run program “cmake“
Error executing CMake: Cannot run program “cmake“
56 0
|
6月前
|
编译器 Linux C语言
CMake指定交叉编译指南:从编译器设置到验证 (CMake Cross-compilation Guide: From Compiler Setup to Verification)
CMake指定交叉编译指南:从编译器设置到验证 (CMake Cross-compilation Guide: From Compiler Setup to Verification)
1781 1
|
6月前
|
Go C语言
安装go-sqlite3包时报exec: "gcc": executable file not found in %PATH%解决办法
安装go-sqlite3包时报exec: "gcc": executable file not found in %PATH%解决办法
271 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错误时的解决方案
712 0
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
编译x264出现错误:No working C compiler found.
编译x264出现错误:No working C compiler found.
338 0
|
计算机视觉
OpenCV编译时提示错误“ Built target libprotobuf”
OpenCV编译时提示错误“ Built target libprotobuf”
644 0