Hi,
I’m getting the following error when trying to link SDL with MinGW32 when building Urho3D as a shared library:
[quote]Linking CXX shared library C:\Urho3D\Bin\Urho3D.dll
…\ThirdParty\SDL\libSDL.a(SDL_mmjoystick.c.obj):SDL_mmjoystick.c:(.text+0x37): undefined reference to joyGetNumDevs@0' ..\ThirdParty\SDL\libSDL.a(SDL_mmjoystick.c.obj):SDL_mmjoystick.c:(.text+0xa2): undefined reference to
joyGetPosEx@8’
…\ThirdParty\SDL\libSDL.a(SDL_mmjoystick.c.obj):SDL_mmjoystick.c:(.text+0xc3): undefined reference to joyGetDevCapsA@12' ..\ThirdParty\SDL\libSDL.a(SDL_mmjoystick.c.obj):SDL_mmjoystick.c:(.text+0x602): undefined reference to
joyGetPosEx@8’
Engine\CMakeFiles\Urho3D.dir\build.make:5784: recipe for target ‘C:/Urho3D/Bin/Urho3D.dll’ failed
CMakeFiles\Makefile2:939: recipe for target ‘Engine/CMakeFiles/Urho3D.dir/all’ failed
Makefile:135: recipe for target ‘all’ failed
c:/mingw/bin/…/lib/gcc/mingw32/4.8.1/…/…/…/…/mingw32/bin/ld.exe: …\ThirdParty\SDL\libSDL.a(SDL_mmjoystick.c.obj): bad reloc address 0x20 in section `.eh_frame’
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [C:/Urho3D/Bin/Urho3D.dll] Error 1
mingw32-make[1]: *** [Engine/CMakeFiles/Urho3D.dir/all] Error 2
mingw32-make: *** [all] Error 2
23:55:55: The process “C:\MinGW\bin\mingw32-make.exe” exited with code 2.
Error while building/deploying project Urho3D (kit: Desktop)
When executing step ‘Make’[/quote]
My CMake configuration is -DURHO3D_OPENGL=1 -DURHO3D_LIB_TYPE=SHARED and the output:
[quote]-- The C compiler identification is GNU 4.8.1
– The CXX compiler identification is GNU 4.8.1
– Check for working C compiler: C:/MinGW/bin/gcc.exe
– Check for working C compiler: C:/MinGW/bin/gcc.exe – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working CXX compiler: C:/MinGW/bin/g++.exe
– Check for working CXX compiler: C:/MinGW/bin/g++.exe – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Using SSE2 instead of SSE because SSE fails on some Windows ports of GCC
– Disable SSE with the CMake option -DURHO3D_SSE=0 if this is not desired
– Looking for include file stdint.h
– Looking for include file stdint.h - found
– Looking for include file wbemcli.h
– Looking for include file wbemcli.h - not found
– Building SDL without DX joystick support due to missing wbemcli.h
– For MSVC, get it from Windows 7 SDK. For MinGW, get it from eg. Wine sources or from MinGW-w64
– Performing Test COMPILER_HAS_DEPRECATED_ATTR
– Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
– Found Urho3D: as CMake target
– Configuring done
– Generating done
– Build files have been written to: C:/Urho3D/Build[/quote]
I got an error previously because I was missing ddraw.h which I took from directx-devel.tar.gz. I don’t quite get why would I need anything from DirectX if I’m compiling with URHO3D_OPENGL set to true, but I have installed DirectX (Jun 2010) just in case.
Both compilation and linking go smoothly if I try to build Urho3D as a static library. I also have a different issue trying to compile in debug mode with Assimp’s object sizes being too large:
[quote]Building CXX object Engine/CMakeFiles/Urho3D.dir/Physics/PhysicsWorld.cpp.obj
c:/mingw/bin/…/lib/gcc/mingw32/4.8.1/…/…/…/…/mingw32/bin/as.exe: CMakeFiles\Assimp.dir\code\IFCReaderGen.cpp.obj: too many sections (33064)
C:\Users\Pablo\AppData\Local\Temp\ccAqKUoY.s: Assembler messages:
C:\Users\Pablo\AppData\Local\Temp\ccAqKUoY.s: Fatal error: can’t write CMakeFiles\Assimp.dir\code\IFCReaderGen.cpp.obj: File too big
c:/mingw/bin/…/lib/gcc/mingw32/4.8.1/…/…/…/…/mingw32/bin/as.exe: CMakeFiles\Assimp.dir\code\IFCReaderGen.cpp.obj: too many sections (33064)
C:\Users\Pablo\AppData\Local\Temp\ccAqKUoY.s: Fatal error: can’t close CMakeFiles\Assimp.dir\code\IFCReaderGen.cpp.obj: File too big
ThirdParty\Assimp\CMakeFiles\Assimp.dir\build.make:2769: recipe for target ‘ThirdParty/Assimp/CMakeFiles/Assimp.dir/code/IFCReaderGen.cpp.obj’ failed
mingw32-make[2]: *** [ThirdParty/Assimp/CMakeFiles/Assimp.dir/code/IFCReaderGen.cpp.obj] Error 1
CMakeFiles\Makefile2:1362: recipe for target ‘ThirdParty/Assimp/CMakeFiles/Assimp.dir/all’ failed
mingw32-make[1]: *** [ThirdParty/Assimp/CMakeFiles/Assimp.dir/all] Error 2[/quote]
Any ideas? Thanks in advance.