Personal tools

WxHaskell/Windows

From HaskellWiki

< WxHaskell(Difference between revisions)
Jump to: navigation, search
(wxWidgets 3.0 and wxHaskell 0.90.x: 0.90.x -> 0.91.x)
(46 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Installing on Windows ==
+
== wxWidgets 3.0 and wxHaskell 0.91.x ==
  +
  +
{|border=1 style="border-collapse: collapse;"
  +
! Windows
  +
! Haskell Platform
  +
! wxWidgets
  +
|-
  +
|| 8.1 || 2013.2.0.0 || 3.0.1
  +
|-
  +
|| 8.1 || 2014.2.0.0 || 3.0.1
  +
|-
  +
|}
  +
  +
  +
Prerequisites:
  +
* [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 and MinGW-make options when installing MinGW. Add the full path to directories MinGW\bin and msys\1.0\bin to your search path.
  +
  +
  +
Environment variables:
  +
  +
* GHC_VERSION: 7.6.3 (some recent version)
  +
* WXC_VERSION: 0.90.1.1 (see [http://hackage.haskell.org/package/wxc Hackage])
  +
* WXWIN: C:\wxWidgets-3.0.1
  +
* 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:
  +
* wxdirect\dist\build\wxdirect
  +
* wxc\dist\build
  +
to ensure that wxdirect.exe and wxc.dll can be found.
  +
  +
Steps:
  +
  +
<ol>
  +
<li> 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:
  +
<pre>
  +
Set path=C:\MinGW\bin;%path%
  +
</pre>
  +
<li> Download [http://wxwidgets.org/downloads wxWidgets 3.0.1 source]
  +
<li> Extract to C:\wxWidgets-3.0.1
  +
<li> [http://wiki.wxwidgets.org/Compiling_wxWidgets_with_MinGW Build wxWidgets-3.0.1]
  +
<br>Edit <tt>wxwidgets-src-dir\build\msw\config.gcc</tt> so that the following values are set:
  +
<pre>
  +
SHARED ?= 1
  +
BUILD ?= release
  +
</pre>
  +
Then (in cmd.exe, ''not'' bash):
  +
<pre>
  +
cd wxwidgets-src-dir\build\msw
  +
sh
  +
mingw32-make -f makefile.gcc
  +
</pre>
  +
<li> Download [https://sourceforge.net/projects/wxhaskell/files/wx-config-win/ wx-config.exe] (a new version for wxWidgets > 3.0) and copy it somewhere into your search path, for instance via
  +
<pre>
  +
copy wx-config.exe %CABAL_DIR%\bin
  +
</pre>
  +
<li> 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:
  +
<pre>
  +
Set path=C:\Haskell\Haskell Platform\2013.2.0.0\mingw\bin\;%path%
  +
</pre>
  +
<li> Install the wxHaskell libraries</li>
  +
To get the most recent version (using [http://git-scm.com/ Git]):
  +
<pre>
  +
git clone git://github.com/wxHaskell/wxHaskell.git
  +
cd wxHaskell\wxdirect
  +
cabal update
  +
cabal install
  +
cd ..\wxc
  +
cabal install
  +
cd ..\wxcore
  +
cabal install
  +
cd ..\wx
  +
cabal install
  +
</pre>
  +
Or, for the Hackage version:
  +
<pre>
  +
cabal update
  +
cabal install wx
  +
</pre>
  +
Or, if you want to install the dependencies separately:
  +
<pre>
  +
cabal update
  +
cabal install wxdirect
  +
cabal install wxc
  +
cabal install wxcore
  +
cabal install wx
  +
</pre>
  +
</ol>
  +
  +
  +
=== DLLs ===
  +
  +
In order to run a wxHaskell application, Windows must be able to find the following wxWidgets DLLs (see [http://msdn.microsoft.com/en-us/library/7d83bc18(v=vs.71).aspx Search Path Used by Windows to Locate a DLL]):
  +
  +
* wxWidgets-x.y.z\lib\gcc_dll\*.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)):
  +
* libgcc_s_dw2-1.dll
  +
* libstdc++-6.dll
  +
* mingwm10.dll
  +
  +
Some wxHaskell applications also require the following DLLs:
  +
* uuid.dll
  +
* perl510.dll
  +
* libapr-1.dll
  +
* libapriconv-1.dll
  +
* libaprutil-1.dll
  +
  +
These DLLs can be obtained by installing [http://sourceforge.net/projects/xampp/files/XAMPP%20Windows/1.7.4/ XAMPP 1.7.4]; the DLLs are in the directories:
  +
* xampp\perl\site\lib\auto\APR\UUID
  +
* xampp\perl\bin
  +
* xampp\apache\bin
  +
  +
If there are still DLLs missing, you can find out which, using [http://cygwin.com/cygwin-ug-net/using-utils.html cygcheck] from the [http://www.cygwin.com/ 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:
  +
C:\programs\cygwin\bin\cygcheck.exe .\h.exe
  +
(the .\ must be specified)
  +
  +
== wxWidgets 2.8 and wxHaskell 0.13.x ==
   
 
Follow [http://www.scribd.com/doc/38034374/20100923-WxHaskell-Setup SkyTreeBird's guide]. It which walks you through the basic steps
 
Follow [http://www.scribd.com/doc/38034374/20100923-WxHaskell-Setup SkyTreeBird's guide]. It which walks you through the basic steps
Line 8: Line 8:
 
* <code>cabal install wx</code>
 
* <code>cabal install wx</code>
   
Note that the best way to refer to WxWidgets in your PATH is probably to use the WXWIN variable that you set, eg. <code>%WXWIN%/lib/gcc_dll</code>
+
Note that the best way to refer to WxWidgets in your PATH is probably to use the WXWIN variable that you set, eg. <code>%WXWIN%\lib\gcc_dll</code>
   
 
The guide has been tested with the following configurations. Others may work too:
 
The guide has been tested with the following configurations. Others may work too:
Line 21: Line 21:
 
|| 7 || 2011.2.0.1 || 2.8.12
 
|| 7 || 2011.2.0.1 || 2.8.12
 
|}
 
|}
  +
  +
  +
=== DLLs ===
  +
  +
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)
  +
  +
* wxmsw28u_gcc_custom.dll
  +
  +
  +
  +
=== 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 <code>c:\Users\<YOUR NAME>\AppData\Roaming\cabal\bin\</code>. This folder must be in your <code>PATH</code> for <code>cabal install wxcore</code> to succeed.
  +
  +
Package wxcore-0.13.2 does not work well with wx-config revision 21 2006-10-19 (downloaded from [http://sites.google.com/site/wxconfig/ here] on Feb 2<sup>nd</sup> 2012). If <code>cabal install wxcore</code> fails with an output containing "Usage: wx-config [options]" try this:
  +
  +
* <code>cabal unpack wxcore</code>
  +
* <code>cd wxcore-0.13.2</code>
  +
* edit <code>Setup.hs</code> and comment out/remove the line containing <code>"wx-config" ["--version"]</code>
  +
* <code>runhaskell.exe Setup.hs configure --user</code>
  +
* <code>runhaskell.exe Setup.hs build</code>
  +
* <code>runhaskell.exe Setup.hs install</code>
  +
  +
Finally call <code>cabal install wx</code>.
   
 
== See also ==
 
== See also ==

Revision as of 19:21, 16 August 2014

Contents

1 wxWidgets 3.0 and wxHaskell 0.91.x

Windows Haskell Platform wxWidgets
8.1 2013.2.0.0 3.0.1
8.1 2014.2.0.0 3.0.1


Prerequisites:

  • 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.


Environment variables:

  • GHC_VERSION: 7.6.3 (some recent version)
  • WXC_VERSION: 0.90.1.1 (see Hackage)
  • WXWIN: C:\wxWidgets-3.0.1
  • 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:

  • wxdirect\dist\build\wxdirect
  • wxc\dist\build

to ensure that wxdirect.exe and wxc.dll can be found.

Steps:

  1. 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:
    Set path=C:\MinGW\bin;%path%
    
  2. Download wxWidgets 3.0.1 source
  3. Extract to C:\wxWidgets-3.0.1
  4. Build wxWidgets-3.0.1
    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
    
  5. Download wx-config.exe (a new version for wxWidgets > 3.0) and copy it somewhere into your search path, for instance via
    copy wx-config.exe %CABAL_DIR%\bin
    
  6. 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%
    
  7. Install the wxHaskell libraries
  8. To get the most recent version (using Git):

    git clone git://github.com/wxHaskell/wxHaskell.git
    cd wxHaskell\wxdirect
    cabal update
    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
    


1.1 DLLs

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):

  • wxWidgets-x.y.z\lib\gcc_dll\*.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)):

  • libgcc_s_dw2-1.dll
  • libstdc++-6.dll
  • mingwm10.dll

Some wxHaskell applications also require the following DLLs:

  • uuid.dll
  • perl510.dll
  • libapr-1.dll
  • libapriconv-1.dll
  • libaprutil-1.dll

These DLLs can be obtained by installing XAMPP 1.7.4; the DLLs are in the directories:

  • xampp\perl\site\lib\auto\APR\UUID
  • xampp\perl\bin
  • xampp\apache\bin

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:

 C:\programs\cygwin\bin\cygcheck.exe .\h.exe

(the .\ must be specified)

2 wxWidgets 2.8 and wxHaskell 0.13.x

Follow SkyTreeBird's guide. It which walks you through the basic steps

  • wx-config
  • wxPack
  • 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. %WXWIN%\lib\gcc_dll

The guide has been tested with the following configurations. Others may work too:

Windows Haskell Platform wxWidgets
XP 2010.2.0.0 2.8.10
7 2011.2.0.1 2.8.12


2.1 DLLs

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)
  • wxmsw28u_gcc_custom.dll


2.2 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 PATH for 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
  • cd wxcore-0.13.2
  • edit Setup.hs and comment out/remove the line containing "wx-config" ["--version"]
  • runhaskell.exe Setup.hs configure --user
  • runhaskell.exe Setup.hs build
  • runhaskell.exe Setup.hs install

Finally call cabal install wx.

3 See also