-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using sdl2: can't load .so/.DLL for: mingw32.dll #41
Comments
This is a long standing problem with the GHCi linker: https://ghc.haskell.org/trac/ghc/ticket/3242 You will encounter the error loading into GHCi, or compiling a TH project I'm currently gathering a more complete story on tge GHC dev side, but Cheers,
|
so there is no current solution or a dirty workaround for it beside dumping TH in my project? With the result that this problem will block my project completely from windows? :( Anyway thanks for the reply, and good luck with fixing it (hopefully soon :P) |
Has any progress been made on this? I can work around loading sdl2 during TH by making a separate package with the TH stuff, but it'd be nice not to have to. I have sdl2 installed via msys2. The
and twice in
Of these 4, the third one (
|
to get around a TemplateHaskell+sdl2 bug on Windows: haskell-game/sdl2#41
As of sdl2-2.0.0 I can build and link as a 64-bit library without encountering this error. See the 64-bit note + Steps 1-5 of https://www.reddit.com/r/haskellgamedev/comments/3kvm7z/building_and_installing_sdl2_200_sdl2image/ |
I'm not able to follow that exact set of instructions, but yes, I do still have this problem with sdl2-2.0.0. To be clear, this is a problem that comes up only when using Template Haskell in a module that also depends on sdl2, or when running a module that depends on sdl2 in
extra-deps:
- sdl2-2.0.0
resolver: lts-3.5
flags: {}
packages:
- '.'
{-# LANGUAGE TemplateHaskell #-}
module Main where
import SDL
$(return [])
main :: IO ()
main = putStrLn "hello world" Steps to reproduce:
Or, remove the Template Haskell lines from Again, without the TH usage, and outside of ghci, everything works fine. I have not tried this all in 64-bit yet -- I can maybe do that soon once I get a 64-bit Windows VM set up. |
@mtolly apologies I misread the original post, didn't realize TH was being used in the linked project, not the bindings themselves. Ignore my post, this will keep occurring until the linked GHC ticket above is fixed |
Well that's something fantastic! Going to try this when I get home.
|
Hi, as you've probably noticed, the previous patch wasn't enough to get |
The patch has been merged into |
Bringing this to light; since GHC 8, the story has vastly improved and this task became irrelevant. @MaxDaten could confirm that using GHC 8 the problems are gone (as is the case for everyone), then we could close this (: |
I can confirm that my test case above works (updated to use stack resolver |
Hooray! Closing this. |
I have currently exactly this problem on Windows 64: http://stackoverflow.com/questions/15996796/haskell-sdl-cant-find-mingw32-dll
building
sdl2
from source and hackage is successful, but using it in a project results in a build error during linking:some ideas whats the problem here or how to workaround it? A mingw32.dll does not exist, I think the lib is statically linked in and is not meant to be dynamically.
I wrote it here (fpco/minghc#28) too, because I'm using minghc 7.8.4 64bit on windows, but I think it's not minghc related.
The text was updated successfully, but these errors were encountered: