[Haskell-cafe] deploy wxHaskell app on Windows

Olaf Klinke olf at aatal-apotheke.de
Fri Sep 22 14:39:57 UTC 2017


Dear Cafe,

I need help deploying a wxHaskell application on Windows.
(The gui at haskell.org list seems to be dormant, as is wxhaskell-users on sourceforge.) I am explicitly CC-ing some people who recently posted about wxHaskell on this list.

TL;DR: How to deploy a wxHaskell application on several Windows machines?
Option (a): Automate the installation of DLLs and tweaking of PATH
Option (b): Build static libs of wxWidgets to be linked into a static binary.
I don't know how to do either.

I developed a GUI application based on wxWidgets. I love the wx package, since wxWidgets provides all the high-level dialogs I need, like file and date pickers. The necessary installations on my Linux development machine went like a charm. Next I tried a Windows 10 machine.
I installed stack, which installed a ghc.exe in %HOME%/AppData/Local/Programs/.../bin/ and cabal and stack binaries in %HOME%/AppData/Roaming/local/bin/.
I downloaded a wx-config.exe binary and placed it in the latter directory and added that to the PATH.
I downloaded wxInstall-Achelanne-64.0.1 and after adding the above path to ghc.exe to it's Install.bat, the Installation completed. Install.bat suggested to add two directories to the PATH, which I did.
I set WXWIN to wxInstall-Achelanne-64.0.1/wxWidgets
and   WXCFG to gcc_dll/mswu
With this, wx-config outputs some flags if requested.
Next, I added
%WXWIN%/include
to extra-include-dirs         
and
%WXWIN%/lib/gcc_dll
to extra-lib-dirs in my stack.yaml.    
I also added %WXWIN%/DLLs
to the extra-lib-dirs in the .cabal file.

%WXWIN%/include/wx/platform.h mentions wx/setup.h which is not there.
Remedy: Copy %WXWIN%/include/wx/msw/setup.h to %WXWIN%/include/wx/setup.h

I believe I did set SHARED=0 in the wxWidgets config but there are no .lib, only .dll files in %WXWIN%, so I can not use ghc -optl-static. Hence the binaries produced by stack need to be told the place of the DLLs via the PATH environment variable. This is something I'd like to avoid on all the machines.

Any suggestions welcome.
Olaf


More information about the Haskell-Cafe mailing list