【发布时间】:2016-08-03 11:03:28
【问题描述】:
我试图编译一个 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
CMakeFiles\cmTC_6b11a.dir\build.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_Portable\Dev-Cpp\minGW32\bin\gcc.exe -o
CMakeFiles\cmTC_6b11a.dir\testCCompiler.c.obj -c
D:\Michal\Pliki\thor-v2.0-sdk\build\CMakeFiles\CMakeTmp\testCCompiler.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.
CMakeFiles\cmTC_6b11a.dir\build.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
感谢您的帮助
【问题讨论】:
-
错误消息的哪一部分“请提交完整的错误报告,如果合适,请提供预处理的源代码。有关说明,请参阅 sourceforge.net/projects/mingw-w64>。”你听不懂?
-
我已经很久没有编译器段错误了。我更感兴趣的是为什么会发生这种情况以及为什么 CMake 无法识别身份
-
为什么?因为您发现了一个编译器错误。如果计算机可以找出自己的错误,他们将能够自己修复所有错误。我们还没有达到这种技术状态。
-
所以?没有法律规定你不能乱用别人的代码。试试吧。你没有什么可失去的,而且你可能真的学到了一些东西。
-
所以尝试手动编译相同的程序。 CMake 构建日志为此包含确切的命令行:它位于行
<built-in>: internal compiler error之前。从构建目录运行此命令行( D:\Michal\Pliki\thor-v2.0-sdk\build\ 在你的情况下)。