
Hello, I am trying to use the SDL-mixer bindings to play wav files. I've hit a wierd error and I can't figure out how to solve it: Prelude> import Graphics.UI.SDL.Mixer.Music Prelude Graphics.UI.SDL.Mixer.Music> loadMUS "test.wav" Loading package SDL-0.5.4 ... linking ... done. Loading package SDL-mixer-0.5.2 ... linking ... <interactive>: /home/norbert/bin/lib/SDL-mixer-0.5.2/ghc-6.8.2/HSSDL-mixer-0.5.2.o: unknown symbol `Mix_LoadWAV' ghc-6.8.2: unable to load package `SDL-mixer-0.5.2' I've looked up the source code; Mix_LoadWAV seems to be #defined, so I suspect it's some kind of library path issue but I don't grok the whole system well enough to figure it out; maybe someone could point me in the right direction? Have the issue now on Ubuntu 8.04 and previously had the same issue when I tested it on a FreeBSD box. I did install all of the "libsdl-*-dev" in the Ubuntu repo. - Norbert

On Tue, 24 Jun 2008, Norbert Wojtowicz wrote:
Hello,
I am trying to use the SDL-mixer bindings to play wav files. I've hit a wierd error and I can't figure out how to solve it:
Prelude> import Graphics.UI.SDL.Mixer.Music Prelude Graphics.UI.SDL.Mixer.Music> loadMUS "test.wav"
Is the package installed? Otherwise you may have to give an -lSDL_mixer option when starting ghci.

lemming:
On Tue, 24 Jun 2008, Norbert Wojtowicz wrote:
Hello,
I am trying to use the SDL-mixer bindings to play wav files. I've hit a wierd error and I can't figure out how to solve it:
Prelude> import Graphics.UI.SDL.Mixer.Music Prelude Graphics.UI.SDL.Mixer.Music> loadMUS "test.wav"
Is the package installed? Otherwise you may have to give an -lSDL_mixer option when starting ghci.
That's not enough, for some reason: $ ghci -lSDL_mixer Prelude> import Graphics.UI.SDL.Mixer.Music Prelude Graphics.UI.SDL.Mixer.Music> loadMUS "test.wav" <interactive>: /home/dons/.cabal/lib/SDL-mixer-0.5.2/ghc-6.8.2/HSSDL-mixer-0.5.2.o: unknown symbol `Mix_LoadWAV' ghc-6.8.2: unable to load package `SDL-mixer-0.5.2' Despite it being defined in $ grep Mix_LoadWAV /usr/lib/* Binary file /usr/lib/libSDL_mixer-1.2.so.0 matches Binary file /usr/lib/libSDL_mixer-1.2.so.0.2.6 matches Binary file /usr/lib/libSDL_mixer.a matches Binary file /usr/lib/libSDL_mixer.so matches Hmm.

wojtowicz.norbert:
Hello,
I am trying to use the SDL-mixer bindings to play wav files. I've hit a wierd error and I can't figure out how to solve it:
Prelude> import Graphics.UI.SDL.Mixer.Music Prelude Graphics.UI.SDL.Mixer.Music> loadMUS "test.wav" Loading package SDL-0.5.4 ... linking ... done. Loading package SDL-mixer-0.5.2 ... linking ... <interactive>: /home/norbert/bin/lib/SDL-mixer-0.5.2/ghc-6.8.2/HSSDL-mixer-0.5.2.o: unknown symbol `Mix_LoadWAV' ghc-6.8.2: unable to load package `SDL-mixer-0.5.2'
I've looked up the source code; Mix_LoadWAV seems to be #defined, so I suspect it's some kind of library path issue but I don't grok the whole system well enough to figure it out; maybe someone could point me in the right direction?
Have the issue now on Ubuntu 8.04 and previously had the same issue when I tested it on a FreeBSD box. I did install all of the "libsdl-*-dev" in the Ubuntu repo.
Ah, well spotted. I get the same issue on Arch, in ghci: Prelude> import Graphics.UI.SDL.Mixer.Music Prelude Graphics.UI.SDL.Mixer.Music> loadMUS "/usr/share/hback-0.0.3/sounds/t.wav" <interactive>: /usr/lib/SDL-mixer-0.5.2/ghc-6.8.2/HSSDL-mixer-0.5.2.o: unknown symbol `Mix_LoadWAV' ghc-6.8.2: unable to load package `SDL-mixer-0.5.2' Looking in the source we see: foreign import ccall unsafe "Mix_LoadWAV" mixLoadWAV :: CString -> IO (Ptr ChunkStruct) Lemmih, any ideas? -lSDL and -lSDL_mixer seem to be there. -- Don

Em Ter, 2008-06-24 às 14:57 -0500, Norbert Wojtowicz escreveu:
Prelude> import Graphics.UI.SDL.Mixer.Music Prelude Graphics.UI.SDL.Mixer.Music> loadMUS "test.wav" Loading package SDL-0.5.4 ... linking ... done. Loading package SDL-mixer-0.5.2 ... linking ... <interactive>: /home/norbert/bin/lib/SDL-mixer-0.5.2/ghc-6.8.2/HSSDL-mixer-0.5.2.o: unknown symbol `Mix_LoadWAV' ghc-6.8.2: unable to load package `SDL-mixer-0.5.2'
Hello. SDL-mixer does not support the most recent SDL version. The problem is that in SDL now Mix_LoadWAV is a macro. -- Marco Túlio Gontijo e Silva Página: http://marcotmarcot.googlepages.com/ Blog: http://marcotmarcot.wordpress.com/ Correio: marcot@riseup.net XMPP: marcot@jabber.org IRC: marcot@irc.freenode.net Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil

marcot:
Em Ter, 2008-06-24 às 14:57 -0500, Norbert Wojtowicz escreveu:
Prelude> import Graphics.UI.SDL.Mixer.Music Prelude Graphics.UI.SDL.Mixer.Music> loadMUS "test.wav" Loading package SDL-0.5.4 ... linking ... done. Loading package SDL-mixer-0.5.2 ... linking ... <interactive>: /home/norbert/bin/lib/SDL-mixer-0.5.2/ghc-6.8.2/HSSDL-mixer-0.5.2.o: unknown symbol `Mix_LoadWAV' ghc-6.8.2: unable to load package `SDL-mixer-0.5.2'
Hello.
SDL-mixer does not support the most recent SDL version. The problem is that in SDL now Mix_LoadWAV is a macro.
Ah ha, so it needs a cbits wrapper over the macro.

SDL-mixer does not support the most recent SDL version. The problem is that in SDL now Mix_LoadWAV is a macro.
I've tried it with SDL-0.5.2 from hackage as well with the same problem. (Unless you mean an earlier version of the actual SDL library?)
Ah ha, so it needs a cbits wrapper over the macro.
This is above my head. If we know what the problem is, will this by any chance hit someone's todo list soon or is this a big hurdle? Are there any other cross-platform (windows + linux at the minimum) ways of playing sounds that anyone can recommend? - Norbert

wojtowicz.norbert:
SDL-mixer does not support the most recent SDL version. The problem is that in SDL now Mix_LoadWAV is a macro.
I've tried it with SDL-0.5.2 from hackage as well with the same problem. (Unless you mean an earlier version of the actual SDL library?)
Ah ha, so it needs a cbits wrapper over the macro.
This is above my head. If we know what the problem is, will this by any chance hit someone's todo list soon or is this a big hurdle?
Are there any other cross-platform (windows + linux at the minimum) ways of playing sounds that anyone can recommend?
Attached is a patched version of SDL_mixer 0.5.2 with a C wrapper for this macro. I'm now able to run loadWAV in ghci. We need to have the maintainer upload the amended version to Hackage, or to give me leave to do so. -- Don
participants (4)
-
Don Stewart
-
Henning Thielemann
-
Marco Túlio Gontijo e Silva
-
Norbert Wojtowicz