stohrendorf/CroftEngine

CroftEngine fails to build on MinGW and CYGWIN

carlo-bramini opened this issue · 1 comments

Compiling CroftEngine on my PC generates this error when linking the final executable:

[100%] Linking CXX executable croftengine.exe
soglb/libsoglb.a(cimgwrapper.cpp.o):cimgwrapper.cp:(.text$_ZN2gl12checkGlErrorEPKc[_ZN2gl12checkGlErrorEPKc]+0x0): multiple definition of `gl::checkGlError(char const*)'; soglb/libsoglb.a(glassert.cpp.o):glassert.cpp:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status

This happens because the whole source code is compiled without NDEBUG defined, but cimgwrapper.cpp.o instead has it, which is defined here:

PROPERTY COMPILE_DEFINITIONS NDEBUG

I have not tried MSVC, but it seems that GNU tools didn't like this code.
Is there a particular reason because it has been made that?
Thank you very much.

Interestingly, this works fine on Linux. The reason for NDEBUG being defined for that file is that the wrapper heavily slowed down startup in debug versions and became a bottleneck.