Search code examples
dllhaskellwxwidgetswxhaskell

Distributing wxHaskell based application in Windows


For a wxHaskell based application distributed on Windows, can I distribute the necessary WX DLLs right alongside the application, without having to do a separate install of WX?

I want to be able to distribute the application as a zip file and not require the user to have anything installed. Is that possible?


Solution

  • I'm by no means a wxHaskell or a wxWidgets expert, but...

    For your use case, it sounds like you want statically linked libraries, not DLLs. WxWidgets seems to be fine with that. So if you use ghc -static -optl-static -optl-pthread, you should get the result you want.

    Some annotation: the -static option isn't really necessary: it's ghc's default. The -optl options get passed to gcc. -optl-static statically links in any C libraries you're using (and I imagine wxHaskell uses some). And -optl-pthread is black magic to me, but it seems like a good idea.