haskell-game/sdl2-image

Calling load causes the program to do nothing. (Windows, Stack)

sullyj3 opened this issue · 4 comments

The following program has no output:

module Main where

import SDL.Image

main :: IO ()
main = do
  putStrLn "hello world"

  f <- load "guy.png"
  putStrLn $ seq f "f loaded"

Commenting out the last two lines gives the expected output "hello world".

On Windows with stack, in stack.yaml:

extra-deps:
- git: https://github.com/haskell-game/sdl2-image.git
  commit: 382395c763b473032721c71921b5c9241142178f

add -optl-mconsole in ghc-mconsole maybe useful

add -optl-mconsole in ghc-mconsole maybe useful

oops ,its ghc-options

Same strugling. Even without calling load, calling initialize is enough.

Yo, fixed all problems with using sdl2-image functions, by adding SDL_image windows binaries into project catalog.
Runtime Binaries: https://www.libsdl.org/projects/SDL_image/

Hope, it's helps someone too!