CMake:C编译器无法编译一个简单的测试程序.令人惊讶的是,C编译器的标识是未知的,但CXX是GNU4.9.2
CMake: The C compiler is not able to compile a simple test program. Surprisingly C compiler identification is unknown but CXX is GNU 4.9.2
我试图编译一个Thor库。这取决于SFML。我在编译同样依赖于SFML的SFGUI时没有遇到任何问题。以前我使用完全相同的工具链。一切正常
CMake-gui错误:
The C compiler identification is unknown
The CXX compiler identification is GNU 4.9.2
Check for working C compiler: E:/Programs_Portable/Dev-Cpp/minGW32/bin/gcc.exe
Check for working C compiler: E:/Programs_Portable/Dev-Cpp/minGW32/bin/gcc.exe -- broken
CMake Error at C:/CMake/share/cmake-3.4/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "E:/Programs_Portable/Dev-Cpp/minGW32/bin/gcc.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: D:/Michal/Pliki/thor-v2.0-sdk/build/CMakeFiles/CMakeTmp
Run Build
Command:"E:/Programs_Portable/Dev-Cpp/minGW32/bin/mingw32-make.exe"
"cmTC_6b11a/fast"
E:/Programs_Portable/Dev-Cpp/minGW32/bin/mingw32-make.exe -f
CMakeFilescmTC_6b11a.dirbuild.make CMakeFiles/cmTC_6b11a.dir/build
mingw32-make.exe[1]: Entering directory
'D:/Michal/Pliki/thor-v2.0-sdk/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_6b11a.dir/testCCompiler.c.obj
E:Programs_PortableDev-CppminGW32bingcc.exe -o
CMakeFilescmTC_6b11a.dirtestCCompiler.c.obj -c
D:MichalPlikithor-v2.0-sdkbuildCMakeFilesCMakeTmptestCCompiler.c
<built-in>: internal compiler error: Segmentation fault
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://sourceforge.net/projects/mingw-w64> for instructions.
CMakeFilescmTC_6b11a.dirbuild.make:64: recipe for target
'CMakeFiles/cmTC_6b11a.dir/testCCompiler.c.obj' failed
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_6b11a.dir/testCCompiler.c.obj]
Error 1
mingw32-make.exe[1]: Leaving directory
'D:/Michal/Pliki/thor-v2.0-sdk/build/CMakeFiles/CMakeTmp'
makefile:125: recipe for target 'cmTC_6b11a/fast' failed
mingw32-make.exe: *** [cmTC_6b11a/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:42 (project)
Configuring incomplete, errors occurred!
See also "D:/Michal/Pliki/thor-v2.0-sdk/build/CMakeFiles/CMakeOutput.log".
See also "D:/Michal/Pliki/thor-v2.0-sdk/build/CMakeFiles/CMakeError.log".
我尝试编译简单的int main(){}
。gcc有效。所有路径都符合预期。(顺便说一句,我不使用DevCpp,它只是编译器的路径)。
我很惊讶,因为g++工作,CMake能够显示身份,但显然不适用于gcc
感谢您的帮助
如果不安装必要的构建包,则消息将出现在Solus OS上。
CMake Error at /usr/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"/usr/bin/cc"
is not able to compile a simple test program.
您必须使用安装软件包
sudo eopkg it -c system.devel
然后它工作得很好。
现在通过将我的GCC从4.9.2升级到4.9.3来修复。崩溃没有更多问题,但显然有一个与C++11标准有关的更改,在编译任何库和任何程序时,我需要手动编辑CMakeLists.txt,将标志-std=c++11
更改为-std=gnu++11
MinGW/Cxx测试异常错误
编辑:切换/更新MinGW发行版解决了所有问题。我尝试将编译器更新到7.2+/8.0+版本,并解决了所有的确认问题。很可能是一个损坏的安装程序或一些旧版本的错误
相关文章:
- C/C++编译器通常会删除重复的库吗
- 模板-模板参数推导:三个不同的编译器三种不同的行为
- Win32编译器选项和内存分配
- MSVC多行宏编译器错误
- 静态数据成员的问题-修复链接错误会导致编译器错误
- C++,我收到一个无法理解的编译器错误
- 在线编译器中的分段C++没有打印消息
- 如何解决gcc编译器优化导致的centos双编译器设置中的分段错误
- C/C++预处理器是否可以检测一些编译器选项
- 是否有C++编译器选项允许激进地删除所有函数调用,并将参数传递给具有空体的函数
- C++错误C2600:无法定义编译器生成的特殊成员函数(必须首先在类中声明)
- 我需要知道编译器如何在cpp中使用析构函数
- 编译器如何区分std::vector的构造函数
- 如何跳过 CMake 编译器标识?
- 编译器如何标识多个字符的ASCII代码
- CXX编译器标识未知:xcode
- CMake:C编译器无法编译一个简单的测试程序.令人惊讶的是,C编译器的标识是未知的,但CXX是GNU4.9.2
- CMake:C编译器标识未知
- Cmake 错误:CXX 编译器标识未知,C 编译器标识未知
- 无法调用派生类的方法 - 编译器将对象实例标识为基类