sdl2gdx icon indicating copy to clipboard operation
sdl2gdx copied to clipboard

SDL.SDL_Init does not work on Jetson Nano

Open peltiern opened this issue 1 year ago • 2 comments

Hello,

I use Jamepad (and therefore SDL) to control a robot with a Logitech F710 gamepad. I have no problem when using it on a normal PC running Ubuntu 22.04.2. Same on a Raspberry Pi 4. But it doesn't work on a Jetson Nano (Ubuntu 18.04 ARMV8). Code stops in class Jamepad.ControllerManager.nativeInitSDLGamepad(l. 99) on

if (SDL.SDL_Init(SDL.SDL_INIT_EVENTS | SDL.SDL_INIT_JOYSTICK | SDL.SDL_INIT_GAMECONTROLLER) != 0){
    return false;
}

There are no errors. The code just doesn't move forward anymore, as if it falls into an infinite loop.

If the native code was not found (SDL library), I think there would have been an error.

Do you have any idea of ​​the problem ?

Thanks,

Nicolas

peltiern avatar Jul 30 '23 09:07 peltiern

Hello,

Do I need to generate the libsdl2gdx64.so file on the Jetson Nano? And how ? In the project, I see the NativesBuild.java class. Is this it?

peltiern avatar Aug 03 '23 16:08 peltiern

I'm having the same problem, you can try to compile by following the steps in BUILDING.md but when building natives for linux it does not have a build-linux.xml for arm just x86 and then it gives me an error because I have g++ arm that compiles arm code because I'm trying to do this on an arm device (I'm trying to get a minecraft mod to work on a nintendo switch (arm device running kubuntu) and that mod uses sdl2gdx, the mod does have a libsdl2gdx64.so but it is for x86) and this is the error that I got:

Executing 'ant -f /home/red/Desktop/sdl2gdx/jni/build-linux64.xml -Dhas-compiler=true -Drelease=true clean postcompile'
Buildfile: /home/red/Desktop/sdl2gdx/jni/build-linux64.xml

clean:

precompile:

create-build-dir:
     [copy] Copying 2 files to /home/red/Desktop/sdl2gdx/jni/build/tmp/linux64

compile:
    [apply] g++: error: unrecognized command-line option ‘-mfpmath=sse’
    [apply] g++: error: unrecognized command-line option ‘-msse’
    [apply] g++: error: unrecognized command-line option ‘-m64’

BUILD FAILED
/home/red/Desktop/sdl2gdx/jni/build-linux64.xml:108: apply returned: 1

I think it is because those paramters for g++ are only available on x86 and that build-linux64.xml only knows how to compile for x86. Please help

gabriel-fondato avatar Aug 06 '24 00:08 gabriel-fondato