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:
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.
Compiling CroftEngine on my PC generates this error when linking the final executable:
This happens because the whole source code is compiled without
NDEBUG
defined, butcimgwrapper.cpp.o
instead has it, which is defined here:https://github.com/stohrendorf/CroftEngine/blob/4820dca140f2fb5dc869e9193380c705629cb9a3/src/soglb/CMakeLists.txt#L59
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.