Open mrgw454 opened 10 months ago
Check the exec permissions on sdl2-config. Doesn't look like it was able to execute that during linking.
I noticed that error as well, but permissions are good (running as user pi):
pi@raspberrypi:~ $ sdl2-config --version
2.26.5
pi@raspberrypi:~ $ whoami
pi
pi@raspberrypi:~ $
pi@raspberrypi:~ $ which sdl2-config
/usr/bin/sdl2-config
pi@raspberrypi:~ $ ls -l /usr/bin/sdl2-config
-rwxr-xr-x 1 root root 1999 Apr 12 2023 /usr/bin/sdl2-config
It could be that is a false error, perhaps due to something else?
Based on this line:
/usr/bin/ld: cannot find /usr/lib//libSDL2.a: No such file or directory
It looks like the linker is unable to determine the architecture type for the system. Is that why you see two // characters in the path?
Here's where the file is on my system:
/usr/lib/aarch64-linux-gnu/libSDL2.a
yeah, the linker can't find it because of the sdl2-config issue. That is a script that is included with SDL to provide appropriate linker options to the linker when using the --static-libs option. Try running that utility script directly with --static-libs and see what it shows. (could also try running the build with sudo, but that shouldn't be necessary if things are working properly).
(see Makefile.SDL) line 23.
Interesting -- that script is included in this package:
pi@raspberrypi:~/source/adamem_sdl $ dpkg -S /usr/bin/sdl2-config
libsdl2-dev:arm64: /usr/bin/sdl2-config
Running it throws the error:
pi@raspberrypi:~/source/adamem_sdl $ sdl2-config --static-libs
/usr/bin/sdl2-config: 61: : Permission denied
/usr/lib//libSDL2.a -lm -lasound -lm -ldl -lpthread -lpulse-simple -lpulse -pthread -lsamplerate -lX11 -lXext -lXcursor -lXi -lXfixes -lXrandr -lXss -ldrm -lgbm -lwayland-egl -lwayland-client -lwayland-cursor -lxkbcommon -ldecor-0 -lpthread -lrt
Seems like a significant bug for that utility. I wonder if there's a work-around (rather than run as root)?
I appreciate your help with this as I'm a big fan of your emulator and wanted to get it going on the RPi5 (like it is on my RPi4 and RPi400).
Thank you!
That is very strange. Well, you should be able to cut-and-paste that line it spit out into the Makefile in place of the call to sdl2-config and it should work I would imagine. Glad to hear you like it and are making use of it. I haven't tried it on that new of a distribution of RPi linux or SDL2 but I have used it before when I had it working in SDL 1.2.
Adding the output from sdl2-config (also fixing the path to the libSDL2.a file) to the Makefile.SDL worked! I tried to search for anyone else with issues using the sdl2-config utility (from the latest 64 bit Raspberry Pi OS 12 Bookworm) but nothing has turned up so far. I have to imagine this issue will present itself soon since that is a common utility to use.
Here's the sed line I used to fix the Makefile.SDL:
sed -i 's|
sdl2-config --static-libs|/usr/lib/aarch64-linux-gnu/libSDL2.a -lm -lasound -lm -ldl -lpthread -lpulse-simple -lpulse -pthread -lsamplerate -lX11 -lXext -lXcursor -lXi -lXfixes -lXrandr -lXss -ldrm -lgbm -lwayland-egl -lwayland-client -lwayland-cursor -lxkbcommon -ldecor-0 -lpthread -lrt|' Makefile.SDL
In any case, thank you so much again for all your help. I hope this information might be useful to anyone else using the same platform and OS version.
From what I've read of it, it's a script and not a binary, so maybe if you add a '-x' to the #!/bin/sh line at the beginning of the script it would provide some additional clues of what's going on... strange.
Hello,
Trying to compile adamem on a new Raspberry Pi 5 system and getting the following error:
I used the command:
make sdl
... to compile.
I have sdl2 2.26.5 installed.
The missing file shown in the error is located on the system:
Any help you can provide would be appreciated. Thank you!