GarageGames / Torque3D

MIT Licensed Open Source version of Torque 3D from GarageGames
http://torque3d.org
MIT License
3.35k stars 1.2k forks source link

libSDL2 issues #1465

Open ghost opened 9 years ago

ghost commented 9 years ago

Hi!

I've had an issue with the precompiled binaries that I've been able to fix. Not sure if was my fault or if it's an issue with the precompiled binaries, but I felt like sharing it anyway.

Specifically I'm following these two guides from the wiki:

http://wiki.torque3d.org/introduction:your-first-project

http://wiki.torque3d.org/coder:compiling-in-linux#toc10

And I'm using the latest package (3.8) from here:

http://wiki.torque3d.org/main:downloads

My system

I have both sdl2 and lib32-sdl2 installed (the latter is only available in the AUR).

Running cmake ../../../.. -DTORQUE_APP_NAME=test -DCMAKE_BUILD_TYPE=Release and make after that, returns no errors, but if you do make install after that, it says that no libSDL2.so could be found in test/buildFiles/arch/Tools/CMake/sdl2/libSDL2.so.

This file does exist in /usr/lib/ and the error goes away if you do cp /usr/lib/libSDL2.0.so ./Tools/CMake/sdl2/

Now if you try to run My Projects/test/game/game, it will say this:

./game: error while loading shared libraries: /HDD1/torque/My Projects/game/game/libSDL2-2.0.so.1: file too short

The error goes away and the engine starts if you copy /usr/lib/libSDL2-2.0.so.0 in the same directory as the executable.

Hope this helps if anyone else is having this issue. Any input as to what caused this, would also be appreciated since I'm trying to learn.

crabmusket commented 8 years ago

Currently the engine is set up to look for a local copy of SDL, which is frustrating, but I believe the decision was made because SDL compatibility between versions is notorious (I'm not close to that area, so I don't remember if that was the exact reason. Also possible: it was easier at the time). The rpath of the compiled binary includes its local directory (see https://github.com/GarageGames/Torque3D/issues?utf8=%E2%9C%93&q=rpath for some stories about this journey).