3

I tried to compile a Thor library. It depends on SFML. I didnt had any problem with compiling SFGUI which also depends on SFML. Previously I used exactly the same toolchain. Everything worked fine

CMake gui errors:

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".

I tried compiling simple int main(){}. gcc works. All paths are as intended. (Btw I don't use DevCpp, its just the path to the compiler).

I am surprised because g++ works, CMake is able to display identification but apparently not for gcc

Thanks for any help

Xeverous
  • 973
  • 1
  • 12
  • 25
  • 1
    What part of the error message "Please submit a full bug report, with preprocessed source if appropriate. See for instructions." you were unable to understand? – Sam Varshavchik Aug 03 '16 at 11:07
  • I haven't had a compiler segfault for ages. I'm more interested why does it happen and why CMake can't figure out identification – Xeverous Aug 03 '16 at 11:15
  • Why? Because you found a compiler bug. If computers could figure out their own bugs, they would be able to fix them all by themselves. We haven't reached this state of technology, just yet. – Sam Varshavchik Aug 03 '16 at 11:17
  • Can I do anything more than submitting the bug and changing/downloading new/other version compiler? – Xeverous Aug 03 '16 at 11:25
  • If you first isolate which source module is triggering the bug, then keep temporarily removing parts of the source and trying to compile it, eventually it will be possible to isolate the specific source statement that's triggering the bug, and figure out if it's possible to rewrite it in an alternative, but logically equivalent way, and avoid triggering it. I found and reported a couple of gcc bugs this way, triggered by my own code. – Sam Varshavchik Aug 03 '16 at 11:52
  • Unfortunately it's not my code but the library one. I am too inexperienced to try edit it – Xeverous Aug 03 '16 at 12:07
  • 1
    So? There's no law that says you can't screw around with someone else's code. Try it. You have nothing to lose, and you might actually learn something. – Sam Varshavchik Aug 03 '16 at 12:09
  • Actually compiler crashed when its trying to compile `a simple test program` provided by CMake – Xeverous Aug 03 '16 at 12:25
  • 4
    So try to compile the same program manually. CMake build log contains exact command line for this: it is before line `: internal compiler error`. Run this command line from the build directory ( D:\Michal\Pliki\thor-v2.0-sdk\build\ in you case). – Tsyvarev Aug 03 '16 at 18:48

2 Answers2

1

The message appears on Solus OS if you don't install the essential build packages.

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.

You have to install the packages, using

sudo eopkg it -c system.devel

Then it works fine.

banan3'14
  • 3,810
  • 3
  • 24
  • 47
  • Switching/updating MinGW distro solved all problems. I updated the compiler and got rid of all confiuration problems. Likely it was a corrupted installaton or some older vrsion bug. – Xeverous Nov 02 '18 at 10:07
0

Fixed now by upgrading my GCC from 4.9.2 to 4.9.3. No more problems with crashing, however apparently there was a change related to C++11 standard and I need to manually edit CMakeLists.txt to change flag -std=c++11 to -std=gnu++11 when compiling any library and any program

MinGW / CxxTest bizarre errors

Edit: Switching/updating MinGW distro solved all problems. I tried updating the compiler to 7.2+/8.0+ versions and got rid of all confiuration problems. Likely it was a corrupted installaton or some older version bug

Xeverous
  • 973
  • 1
  • 12
  • 25