Skip to content
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 #28

Closed
MaxDaten opened this issue Feb 9, 2015 · 7 comments
Closed

using sdl2: can't load .so/.DLL for: mingw32.dll #28

MaxDaten opened this issue Feb 9, 2015 · 7 comments

Comments

@MaxDaten
Copy link

MaxDaten commented Feb 9, 2015

Hi it's me again with a similar problem as in #5

I'm trying to use the sdl2 package on windows (mostly for developing in (quine)[ekmett/quine]). After some pitfalls I'm able to build the sdl2 package from source and from hackage. My current build flow:

  • unpack the SDL2-devel-2.0.3-mingw.tar.gz from https://www.libsdl.org/download-2.0.php into C:\SDL2-2.0.3
  • cabal get sdl2
  • cd sdl2
  • cabal configure --extra-include-dirs="C:\\SDL2-2.0.3\\include" --extra-lib-dirs="C:\\SDL2-2.0.3\\x86_64-w64-mingw32\\lib"
  • cabal build

the build is successful but using the lib in an other project results in a build error:

Loading package sdl2-1.3.0 ...
<no location info>:
    <command line>: can't load .so/.DLL for: mingw32.dll (addDLL: could not load DLL)
[49 of 51] Compiling Quine.Geometry.Frustum ( src\Quine\Geometry\Frustum.hs, dist\build\Quine\Geometry\Frustum.o )

<no location info>:
    ghc.exe: panic! (the 'impossible' happened)
  (GHC version 7.8.4 for x86_64-unknown-mingw32):
        Dynamic linker not initialised

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

the relevant lines from the SDL pkg-config:

Libs: -L${libdir}  -lmingw32 -lSDL2main -lSDL2  -mwindows
Libs.private: -lmingw32

I believe that there is no mingw32.dll in MinGW. A wild guess: something tries to link dynamically while it should linked statically?

related on SO: http://stackoverflow.com/questions/15996796/haskell-sdl-cant-find-mingw32-dll

I'm a bit lost here. Is this really a ghc bug? Should I report it there? Or is this a bug of this bundle. I'm using the GHC 7.8.4 (64-bit) version of MinGHC.

@MaxDaten
Copy link
Author

MaxDaten commented Feb 9, 2015

okay sorry for the noise, it's a known bug. https://ghc.haskell.org/trac/ghc/ticket/3242
so no windows for my project :(

@ndmitchell
Copy link
Collaborator

Sorry to hear that, not much for us to do then.

@akhra
Copy link

akhra commented Feb 9, 2015

Note that this bug is specific to 64-bit GHC (and the reason I'm using 32). If you can make that switch, also see here for how to avoid a bug on the SDL2-devel library side.

@MaxDaten
Copy link
Author

MaxDaten commented Feb 9, 2015

@tejon thank you very much for this information. I will consider now to switch to 32bit!

@MaxDaten
Copy link
Author

MaxDaten commented Feb 9, 2015

sorry for the noise again:
I switched to the x32 version and ran into another bug...

like above but with x32 pathes:

  • cabal get sdl2
  • cd sdl2
  • cabal configure --extra-include-dirs="C:\\SDL2-2.0.3\\include" --extra-lib-dirs="C:\\SDL2-2.0.3\\i686-w64-mingw32\\lib"
  • cabal build

results in this error:

cabal get sdl2
Building sdl2-1.3.0...
Preprocessing library sdl2-1.3.0...
running dist\build\Graphics\UI\SDL\Types_hsc_make.exe failed (exit code -1073741701)
command was: dist\build\Graphics\UI\SDL\Types_hsc_make.exe  >dist\build\Graphics\UI\SDL\Types.hs

and a windows error dialog pops out with the error code 0xc000007b

@Kludgy
Copy link

Kludgy commented Feb 9, 2015

The x86_64 mingw lib path looks suspicious.

Cheers,
Darren
On Feb 9, 2015 1:15 PM, "Jan-Philip Loos" notifications@github.com wrote:

sorry for the noise again:
I switched to the x32 version and ran into another bug...

like above:

  • cabal get sdl2
  • cd sdl2
  • cabal configure --extra-include-dirs="C:\SDL2-2.0.3\include"
    --extra-lib-dirs="C:\SDL2-2.0.3\x86_64-w64-mingw32\lib"
  • cabal build

results in this error:

cabal get sdl2
Building sdl2-1.3.0...
Preprocessing library sdl2-1.3.0...
running dist\build\Graphics\UI\SDL\Types_hsc_make.exe failed (exit code -1073741701)
command was: dist\build\Graphics\UI\SDL\Types_hsc_make.exe >dist\build\Graphics\UI\SDL\Types.hs

and a windows error dialog pops out with the error code 0xc000007b


Reply to this email directly or view it on GitHub
#28 (comment).

@MaxDaten
Copy link
Author

MaxDaten commented Feb 9, 2015

@Kludgy sorry was a c&p error, I corrected it just a minute after hitting the comment button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants