problem with SDL-gfx

Hello! I hope you can help me. I'm trying to use SDL-gfx but it seems it isn't linking it correctly. When I try to run this simple file with runhaskell: import Graphics.UI.SDL.Primitives main = putStrLn "Hello" It gives: sdl.test.hs: <command line>: can't load .so/.DLL for: /home/username/.cabal/lib/i386-linux-ghc-7.10.2/SDL-gfx-0.6.0.1-6rhSP5mw8M00K9S8yASTVF/ libHSSDL-gfx-0.6.0.1-6rhSP5mw8M00K9S8yASTVF-ghc7.10.2.so (/home/username/.cabal/lib/i386-linux-ghc-7.10.2/SDL-gfx-0.6.0.1-6rhSP5mw8M00K9S8yASTVF/ libHSSDL-gfx-0.6.0.1-6rhSP5mw8M00K9S8yASTVF-ghc7.10.2.so: undefined symbol: SDL_initFramerate) Notes: * SDL works fine in all cases. * My system is i386, using Arch Linux. I tried with another computer with x86_64 with Arch Linux and it worked. * It works if I compile it with ghc and run the executable. * I installed the package using cabal install SDL-gfx with no errors. * I installed the library in the OS just in case, and double checked that it exist in /usr/lib/libSDL_gfx.so and that it contains the symbol SDL_initFramerate. * The long *.so library reported by runhaskell also constains SDL_initFramerate. * GHCi gives the same error (when executing main). * I'm trying to make a cabal package that uses this library, and cabal gave the same error within the sandbox.

On Tue, Dec 08, 2015 at 12:44:18PM -0300, Martín Villagra wrote:
Hello! I hope you can help me. I'm trying to use SDL-gfx but it seems it isn't linking it correctly. When I try to run this simple file with runhaskell: import Graphics.UI.SDL.Primitives main = putStrLn "Hello"
It gives: sdl.test.hs: <command line>: can't load .so/.DLL for: [..]
Hello Martín, SDL-gfx maintainer here. Could you try: runhaskell -L/usr/include/SDL/ -lSDL_gfx prova.hs (this works in Debian, modify the -L dir appropriately if you are using Arch).

Same error :/
The include folder (/usr/include/SDL/) contained the expected files.
(SDL_framerate.h and others)
I even recompiled and reinstalled the library but still says the same.
On Tue, Dec 8, 2015 at 3:58 PM, Francesco Ariis
On Tue, Dec 08, 2015 at 12:44:18PM -0300, Martín Villagra wrote:
Hello! I hope you can help me. I'm trying to use SDL-gfx but it seems it isn't linking it correctly. When I try to run this simple file with runhaskell: import Graphics.UI.SDL.Primitives main = putStrLn "Hello"
It gives: sdl.test.hs: <command line>: can't load .so/.DLL for: [..]
Hello Martín, SDL-gfx maintainer here. Could you try:
runhaskell -L/usr/include/SDL/ -lSDL_gfx prova.hs
(this works in Debian, modify the -L dir appropriately if you are using Arch). _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

On Tue, Dec 08, 2015 at 09:21:39PM -0300, Martín Villagra wrote:
Same error :/ The include folder (/usr/include/SDL/) contained the expected files. (SDL_framerate.h and others) I even recompiled and reinstalled the library but still says the same.
Gotcha, I forgot to to put an extra-libraries: in the .cabal file (let me thank Ivan Perez, who had a similar problem on sdl-image and provided the right diagnosis). I have uploaded the new version to hackage, install it and then type: runhaskell -lSDL_gfx your-test-file.hs It should work. Ciao -F

It works perfect now :D :D
Now I can use it in my project, I didn't even need the -lSDL_gfx.
Many thanks for this fast fix!
On Thu, Dec 10, 2015 at 1:34 AM, Francesco Ariis
On Tue, Dec 08, 2015 at 09:21:39PM -0300, Martín Villagra wrote:
Same error :/ The include folder (/usr/include/SDL/) contained the expected files. (SDL_framerate.h and others) I even recompiled and reinstalled the library but still says the same.
Gotcha, I forgot to to put an extra-libraries: in the .cabal file (let me thank Ivan Perez, who had a similar problem on sdl-image and provided the right diagnosis).
I have uploaded the new version to hackage, install it and then type:
runhaskell -lSDL_gfx your-test-file.hs
It should work. Ciao -F
participants (2)
-
Francesco Ariis
-
Martín Villagra