Skip to content

remote-iserv: Cannot load dll when cross-compiling with mingwW64 #1098

Closed
@ramirez7

Description

@ramirez7

I've been working to cross-compile some games that use SDL2 and related libraries (sdl-gpu, OpenGL, etc)

It's all been working fine. I've been able to make games that run with Wine and Windows proper!

However, I am running into this issue now that I am using TH, which in turn causes remote-iserv to come into play. TH fails with:

[ 9 of 13] Compiling SDL.Utils        ( src/SDL/Utils.hs, dist/build/SDL/Utils.o )
Could not load wine-gecko. HTML rendering will be disabled.
wine: configuration in '/build' has been updated.
Listening on port 9581
remote-iserv.exe: Could not load `SDL2.dll'. Reason: addDLL: SDL2.dll or dependencies not loaded. (Win32 error 126)

remote-iserv.exe: loadArchive "/nix/store/z3jrsabqrpx2adxygvjd78mvfdfqxlqk-SDL2-2.0.12-x86_64-w64-mingw32/lib/libSDL2.dll.a": failed
iserv-proxy: {handle: <socket: 5>}: GHCi.Message.remoteCall: end of file

<no location info>: error: ghc: ghc-iserv terminated (1)

FWIW, my SDL2 output in the Nix store looks like this. I did tweak the packaging a bit for mingw with an overlay.

$ tree /nix/store/z3jrsabqrpx2adxygvjd78mvfdfqxlqk-SDL2-2.0.12-x86_64-w64-mingw32/
/nix/store/z3jrsabqrpx2adxygvjd78mvfdfqxlqk-SDL2-2.0.12-x86_64-w64-mingw32/
├── bin
│   └── SDL2.dll
└── lib
    ├── libSDL2.dll.a
    ├── libSDL2main.a
    └── libSDL2_test.a

2 directories, 4 files

That said, outside of TH, my tweaks to SDL2 are working fine. Is there something that needs to be done for remote-iserv to get visibility of SDL2.dll? My cabal builds all rely on pkg-config. I looked into it, and Win32 error 126 usually means "a file related to the service is missing or cannot be found."

The code is here. I'm currently doing a weekend game jam, so for now I will try to hack a workaround where I dump splices on Linux and have the Windows build use those instead.

Aside from this issue, the Haskell x-compiling has been a godsend for me. I look forward to using it for bigger and better things! Thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwontfix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions