Open NeonFrost opened 2 weeks ago
On Fedora x86-64
I needed sudo dnf install SDL2_mixer
. Can you try installing one of the libraries mentioned in the error message ("libSDL2_mixer-2.0.so.0" "libSDL2_mixer")
?
I forgot to mention I'm on Xubuntu 24.04, apologies about that and the path to SDL2_mixer.h is /usr/include/SDL2/SDL_mixer.h
I've already installed them through the apt package manager
libsdl2-mixer-2.0-0/noble,now 2.8.0+dfsg-1build3 amd64 [installed]
libsdl2-mixer-dev/noble,now 2.8.0+dfsg-1build3 amd64 [installed]
I ran into a similar problem several years ago, and the way I had solved it was by installing the -dev package along with the 2.0 package.
While looking to see if there was anything I could test to make it work, I used the following repo to make sure that sdl2-mixer was able to be called and used https://github.com/aminosbh/sdl2-mixer-sample
libSDL2_mixer.so, libSDL2_mixer-2.0.so, and libSDL2_mixer-2.0.so.0 are all accessible through /lib/x86_64-linux-gnu on my system
After running through a bunch of different things, I found a problem
in src/library.lisp theres the line: (:unix (:or "libSDL2_mixer-2.0.so.0" "libSDL2_mixer"))
adding .so onto "libSDL2_mixer" made it so the error didn't pop up, but it seems to affect the rest of the cl-sdl2 system, causing things to not work properly
Running the simple example for cl-sdl2-mixer causes the lisp repl to hang, not even opening a window, which is what happens when I load cl-sdl2-mixer in my own program and try to launch an sdl2 window
After trying that, I tried using the previous release of cl-sdl2-mixer from 2021, however the same exact problem occurred
I think there may be a problem in cl-sdl2, rather than cl-sdl2-mixer
As far as I can tell, when (with-init (:everything) ...) is called, something in cl-sdl2 and cl-sdl2-mixer clashes, but I'm not sure how to proceed with trying to fix it
Edit: I forgot to say, that with my program, even loading cl-sdl2-mixer is enough to cause it to 'hang', even if it's not initialized (well, after with-init is called)
edit 2: If I don't load cl-sdl2-mixer, my program (the tamias game engine) is able to have its default window pop up, but if I load mixer, it hangs
Hi, I'm not sure if you've been able to, or have had the time to, recreate this problem. I am still having the same issue.
I have: uninstalled and reinstalled libsdl2-mixer using apt (along with the other sdl2 libs), cleared the quicklisp cache, cleared the relevant archives from quicklisp folders, and have tried inserting (and subsequently deleting) simple "This loaded" messages into cffi to see if things aren't getting clobbered, compared cl-sdl2-image and cl-sdl2-mixer code (cl-sdl2-image loads without issue on my system, along with being able to bring an sdl2 window up) to see if removing things would get it to load (and hopefully bring up a window)
None of these worked.
During my attempts at changing things around and seeing what might be the problem, I did find that cffi seems to be handling sdl2-mixer a little differently than sdl2 and sdl2-image.
It seems as though if cffi gets 3 options for library names for sdl2-mixer, it silently fails, loading the third option it receives for the library path, as long as that library exists (e.g. 'libSDL2_mixer.so' will silently fail, but 'libdoesnotexist.so' will send it to debugger)
I did find that the problem is triggered from the line (cffi:use-foreign-library libsdl2-mixer)
in src/library.lisp rather than in the define-foreign-library block.
Edit: Forgot to add that this is what the '3 options' thing does: `(ql:quickload :sdl2-mixer) (ql:quickload :sdl2-image) (in-package :cffi)
(list-foreign-libraries)
(#<FOREIGN-LIBRARY LIBSDL2-IMAGE "libSDL2_image-2.0.so.0">
#<FOREIGN-LIBRARY LIBSDL2-MIXER "libSDL2_mixer.so">
#<FOREIGN-LIBRARY LIBSDL2 "libSDL2-2.0.so.0">) the libraries listed (under src/library.lisp)
(:unix (:or "libSDL2_mixer-2.0.so.0" "libSDL2_mixer" "libSDL2_mixer.so")) ;;last one I added
(:unix (:or "libSDL2_image-2.0.so.0" "libSDL2_image" "libSDL2_image.so.1.1"))
(:unix (:or "libSDL2-2.0.so.0" "libSDL2.so.0.2" "libSDL2"))`
Thank you to everybody contributing to this project :)
[using SBCL] (ql:quickload :sdl2-mixer) causes repl to drop to debugger, requiring user input of restart 0, does not happen with sdl2, sdl2-image or sdl2-ttf
restart 0 (reload foreign library) 'fixes' problem, but must be done each time lisp is started (through slime or cli) info: