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月前
|
Java Maven
Error executing CMake: Cannot run program “cmake“
Error executing CMake: Cannot run program “cmake“
73 0
|
7月前
|
编译器 Linux C语言
CMake指定交叉编译指南:从编译器设置到验证 (CMake Cross-compilation Guide: From Compiler Setup to Verification)
CMake指定交叉编译指南:从编译器设置到验证 (CMake Cross-compilation Guide: From Compiler Setup to Verification)
1870 1
|
7月前
|
Go C语言
安装go-sqlite3包时报exec: "gcc": executable file not found in %PATH%解决办法
安装go-sqlite3包时报exec: "gcc": executable file not found in %PATH%解决办法
274 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编译
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
727 0
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
|
编译器 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错误
471 0
CodeBlocks出现Can‘t find compiler executable in your search path for GNU GCC Compier错误
|
计算机视觉
OpenCV编译时提示错误“ Built target libprotobuf”
OpenCV编译时提示错误“ Built target libprotobuf”
659 0
|
Java C++
C++编译错误解决办法:Class_Label[abi:cxx11]'被多次定义
C++编译错误解决办法:Class_Label[abi:cxx11]'被多次定义
163 0