Difference between revisions of "WxHaskell/Windows"
(→wxWidgets 2.9 and wxHaskell 0.90.x: Improved WXC_VERSION text)
(→wxWidgets 2.9 and wxHaskell 0.90.x: Expanded Prerequisites info)
|Line 12:||Line 12:|
* [http://sourceforge.net/projects/mingw/files/OldFiles/MinGW%205.1.6/ MinGW 5.1.6] and [http://downloads.sourceforge.net/mingw/MSYS-1.0.11.exe MSYS
* [http://sourceforge.net/projects/mingw/files/OldFiles/MinGW%205.1.6/ MinGW 5.1.6] and [http://downloads.sourceforge.net/mingw/MSYS-1.0.11.exe MSYS 1.0.11 (a recent version of MinGW will result in incompatible DLLs). You must select the C++ compiler when installing MinGW.
Revision as of 06:18, 18 May 2014
wxWidgets 2.9 and wxHaskell 0.90.x
- MinGW 5.1.6 and MSYS 1.0.11 (a recent version of MinGW will result in incompatible DLLs). You must select the C++ compiler and MinGW-make options when installing MinGW. Add the full path to directories MinGW\bin and msys\1.0\bin to your search path.
- GHC_VERSION: 7.6.3 (some recent version)
- WXC_VERSION: 0.90.1.1 (see Hackage)
- WXWIN: C:\wxWidgets-2.9.5
- WXCFG: gcc_dll\mswu
- PATH: (add these) %WXWIN%\lib\gcc_dll;%WXWIN%;%APPDATA%\cabal\wxc-%WXC_VERSION%\%GHC_VERSION%
If you are using cabal-dev, you must add the following to your search path:
to ensure that wxdirect.exe and wxc.dll can be found.
- Make sure, that the GCC from the MinGW package is used for compilation of wxWidgets, by adding its directory to the start of the search path, with a command like:
- Download wxWidgets 2.9.5 source
- Extract to C:\wxWidgets-2.9.5
- Build wxWidgets-2.9.5
Edit wxwidgets-src-dir\build\msw\config.gcc so that the following values are set:
SHARED ?= 1 BUILD ?= release
Then (in cmd.exe, not bash):
cd wxwidgets-src-dir\build\msw sh mingw32-make -f makefile.gcc
- Download wx-config.exe (a new version for wxWidgets > 2.9) and copy it somewhere into your search path, for instance via
copy wx-config.exe %CABAL_DIR%\bin
- Make sure, that the GCC that comes with GHC is used for the rest of the procedure, by adding its directory to the search path, with a command like:
Set path=C:\Haskell\Haskell Platform\2013.2.0.0\mingw\bin\;%path%
- Install the wxHaskell libraries
To get the most recent version (using Git):
git clone git://github.com/wxHaskell/wxHaskell.git cd wxHaskell\wxdirect cabal install cd ..\wxc cabal install cd ..\wxcore cabal install cd ..\wx cabal install
Or, for the Hackage version:
cabal update cabal install wx
Or, if you want to install the dependencies separately:
cabal update cabal install wxdirect cabal install wxc cabal install wxcore cabal install wx
In order to run a wxHaskell application, Windows must be able to find the following wxWidgets DLLs (see Search Path Used by Windows to Locate a DLL):
The following file can be found in directory wxc\dist\build\, after building package wxc in directory wxc:
- wxc.dll (be sure to recompile and copy this one when you compile your application with a new compiler)
Furthermore, the following DLLs need to be in the search path (these can be found in directory "Haskell Platform\2012.2.0.0\mingw\bin\", or in ghc-7.4.2\mingw\bin\ if you installed the compiler only (change revision as needed)):
Some wxHaskell applications also require the following DLLs:
These DLLs can be obtained by installing XAMPP 1.7.4; the DLLs are in the directories:
If there are still DLLs missing, you can find out which, using cygcheck from the Cygwin project. Note, that you will get problems if you have both MinGW and Cygwin in your search path; it is best to specify the full path to cygcheck.exe, or copy cygcheck.exe to some location in the search path. Sample command:
(the .\ must be specified)
wxWidgets 2.8 and wxHaskell 0.13.x
Follow SkyTreeBird's guide. It which walks you through the basic steps
- setting up environment variables
cabal install wx
Note that the best way to refer to WxWidgets in your PATH is probably to use the WXWIN variable that you set, eg.
The guide has been tested with the following configurations. Others may work too:
In order to run a wxHaskell application, the following DLLs must be in the search path:
- mingwm10.dll; this can be found in directory "Haskell Platform\2012.2.0.0\mingw\bin\", or in ghc-7.4.2\mingw\bin\ if you installed just the compiler (change revision as needed)
Troubleshooting installation with cabal
These remarks refer to wx-0.13.2 and Haskell Platform 2011.4.0.0 on Windows 7.
Cabal package wx depends on wxcore which depends on wxdirect. By default cabal installs on a per user base, thus wxdirect.exe will be installed to
c:\Users\<YOUR NAME>\AppData\Roaming\cabal\bin\. This folder must be in your
cabal install wxcore to succeed.
Package wxcore-0.13.2 does not work well with wx-config revision 21 2006-10-19 (downloaded from here on Feb 2nd 2012). If
cabal install wxcore fails with an output containing "Usage: wx-config [options]" try this:
cabal unpack wxcore
Setup.hsand comment out/remove the line containing
runhaskell.exe Setup.hs configure --user
runhaskell.exe Setup.hs build
runhaskell.exe Setup.hs install
cabal install wx.