关于 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


测试通过


相关文章
|
编译器 Go 开发工具
常见问题之Golang——cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in %PATH%错误
本文主要是对我日常在使用golang时遇到的一些问题与解决方式进行的汇总,在此提供给大家便于排查一些遇到的问题,其中有更好的解决方案可在评论区留言。
1100 0
常见问题之Golang——cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in %PATH%错误
|
5月前
|
存储 Shell iOS开发
CMake中文手册_target_link_libraries(3.26)
CMake中文手册_target_link_libraries(3.26)
236 0
|
5月前
|
IDE 开发工具 C++
CMake中文手册_target_sources(3.26)
CMake中文手册_target_sources(3.26)
416 0
|
5月前
|
测试技术 iOS开发 Perl
废弃第三方库导致的library not found for -lXXXXX(linker command failed ) 完美解决方法
废弃第三方库导致的library not found for -lXXXXX(linker command failed ) 完美解决方法
41 0
|
5月前
|
编译器 Linux C语言
CMake指定交叉编译指南:从编译器设置到验证 (CMake Cross-compilation Guide: From Compiler Setup to Verification)
CMake指定交叉编译指南:从编译器设置到验证 (CMake Cross-compilation Guide: From Compiler Setup to Verification)
1449 1
|
5月前
|
Go C语言
安装go-sqlite3包时报exec: "gcc": executable file not found in %PATH%解决办法
安装go-sqlite3包时报exec: "gcc": executable file not found in %PATH%解决办法
215 0
|
5月前
解决运行qmake:Project ERROR: Cannot run compiler ‘cl‘. Output:
解决运行qmake:Project ERROR: Cannot run compiler ‘cl‘. Output:
545 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报错信息