Difference between revisions of "WxHaskell/Windows"
(copy wxWidgets build instructions here) |
(→DLLs: Corrected the path for the XAMPP DLLs) |
||
(15 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
+ | == wxWidgets 2.9 and wxHaskell 0.90.x == |
||
− | == Installing on Windows == |
||
+ | |||
+ | {|border=1 style="border-collapse: collapse;" |
||
+ | ! Windows |
||
+ | ! Haskell Platform |
||
+ | ! wxWidgets |
||
+ | |- |
||
+ | || 7 || 2011.2.0.1 || 2.9.3 |
||
+ | |- |
||
+ | |} |
||
+ | |||
+ | |||
+ | Prerequisites: |
||
+ | * [http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer MinGW] 5.1.6 and [http://downloads.sourceforge.net/mingw/MSYS-1.0.11.exe MSYS] 1.0.11 (these are the latest versions at the time of writing). You must select the C++ compiler option when installing MinGW. |
||
+ | |||
+ | Environment variables: |
||
+ | |||
+ | * CABAL_DIR: C:\Users\XXX\AppData\Roaming\cabal (Windows XP: C:\Documents and Settings\XXX\Application Data\cabal, or for all Windows versions: %APPDATA%\cabal) |
||
+ | * GHC_VERSION: 7.0.3 (for our convenience) |
||
+ | * WXC_VERSION: 0.90.0.2 |
||
+ | * WXWIN: C:\wxWidgets-2.9.3 |
||
+ | * WXCFG: gcc_dll\mswu |
||
+ | * PATH: (add these) %WXWIN%\lib\gcc_dll;%WXWIN%;%CABAL_DIR%\wxc-%WXC_VERSION%\%GHC_VERSION% |
||
+ | |||
+ | Steps: |
||
+ | |||
+ | <ol> |
||
+ | <li> Download [http://wxwidgets.org/downloads wxWidgets 2.9.3 source] |
||
+ | <li> Extract to C:\wxWidgets-2.9.3 |
||
+ | <li> [http://wiki.wxwidgets.org/Compiling_wxWidgets_with_MinGW Build wxWidgets-2.9.3] |
||
+ | <br>I (who?) compiled it as follows: 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 |
||
+ | 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 > 2.9) and copy it somewhere into your path, for instance via |
||
+ | <pre> |
||
+ | cp wx-config.exe %CABAL_DIR%\bin |
||
+ | </pre> |
||
+ | <li> Install the wxHaskell libraries |
||
+ | <pre> |
||
+ | cabal install wxdirect |
||
+ | cabal install wxc |
||
+ | cabal install wxcore |
||
+ | cabal install wx |
||
+ | </pre> |
||
+ | </ol> |
||
+ | |||
+ | === DLLs === |
||
+ | |||
+ | In order to run a wxHaskell application, the following wxWidgets DLLs must be in the search path: |
||
+ | |||
+ | (If you built wxWidgets in directory wxWidgets-2.9.3, |
||
+ | the following files can be found in wxWidgets-2.9.3\lib\gcc_dll\ (change revision as needed)) |
||
+ | * wxbase293u_gcc_custom.dll |
||
+ | * wxbase293u_net_gcc_custom.dll |
||
+ | * wxbase293u_xml_gcc_custom.dll |
||
+ | * wxmsw293u_adv_gcc_custom.dll |
||
+ | * wxmsw293u_aui_gcc_custom.dll |
||
+ | * wxmsw293u_core_gcc_custom.dll |
||
+ | * wxmsw293u_gl_gcc_custom.dll |
||
+ | * wxmsw293u_html_gcc_custom.dll |
||
+ | * wxmsw293u_propgrid_gcc_custom.dll |
||
+ | * wxmsw293u_ribbon_gcc_custom.dll |
||
+ | * wxmsw293u_richtext_gcc_custom.dll |
||
+ | * wxmsw293u_stc_gcc_custom.dll |
||
+ | * wxmsw293u_xrc_gcc_custom.dll |
||
+ | |||
+ | The following file can be found in directory wxc\dist\build\, after building package wxc in directory wxc: |
||
+ | * wxc.dll |
||
+ | |||
+ | 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 |
||
+ | * libaprutil-1.dll |
||
+ | |||
+ | These DLLs can be obtained by installing [http://sourceforge.net/projects/xampp/ XAMPP]; the DLLs are in the directories: |
||
+ | * xampp\perl\site\lib\auto\APR\UUID |
||
+ | * xampp\perl\bin |
||
+ | * xampp\apache\bin |
||
+ | |||
+ | == 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 10: | Line 101: | ||
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: |
+ | The guide has been tested with the following configurations. Others may work too: |
− | {|border=1 style="border-collapse: collapse; |
+ | {|border=1 style="border-collapse: collapse;" |
! Windows |
! Windows |
||
! Haskell Platform |
! Haskell Platform |
||
+ | ! wxWidgets |
||
|- |
|- |
||
− | || XP || 2010.2.0.0 |
+ | || XP || 2010.2.0.0 || 2.8.10 |
|- |
|- |
||
− | || 7 || 2011.2.0.1 |
+ | || 7 || 2011.2.0.1 || 2.8.12 |
|} |
|} |
||
− | == Building your own wxWidgets (optional) == |
||
+ | === DLLs === |
||
− | '''Note:''' ''Microsoft compilers are no longer supported. The cabal build system cannot understand the output of wx-config for Microsoft compilers.'' |
||
+ | |||
+ | 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. |
||
− | '''Note:''' ''The Haskell Platform 2010.1.0.0 installer shipped without C++ support. If you want to build wxHaskell on Windows using this Haskell Platform, please see [http://wewantarock.wordpress.com/2010/05/05/haskell-platform-2010-1-0-0-and-wxhaskell-on-windows/]'' |
||
+ | 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: |
||
− | Using the MSYS shell, and making sure that you have the C++ compiler option installed for MinGW as it is 'not' the default: |
||
+ | * <code>cabal unpack wxcore</code> |
||
− | > cd /c/path/to/wxWidgets-2.8.10/build/msw |
||
+ | * <code>cd wxcore-0.13.2</code> |
||
− | > mingw32-make -f makefile.gcc BUILD=release MONOLITHIC=1 SHARED=1 UNICODE=1 |
||
+ | * 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>. |
||
− | This will take quite some time and generate lots of text in the MSYS shell. Assuming it is successful, a DLL is generated in /c/path/to/wxWidgets/gcc_dll, which you will need to copy to a location where it can be found when running your executables. |
||
== See also == |
== See also == |
Revision as of 11:44, 13 September 2012
wxWidgets 2.9 and wxHaskell 0.90.x
Windows | Haskell Platform | wxWidgets |
---|---|---|
7 | 2011.2.0.1 | 2.9.3 |
Prerequisites:
- MinGW 5.1.6 and MSYS 1.0.11 (these are the latest versions at the time of writing). You must select the C++ compiler option when installing MinGW.
Environment variables:
- CABAL_DIR: C:\Users\XXX\AppData\Roaming\cabal (Windows XP: C:\Documents and Settings\XXX\Application Data\cabal, or for all Windows versions: %APPDATA%\cabal)
- GHC_VERSION: 7.0.3 (for our convenience)
- WXC_VERSION: 0.90.0.2
- WXWIN: C:\wxWidgets-2.9.3
- WXCFG: gcc_dll\mswu
- PATH: (add these) %WXWIN%\lib\gcc_dll;%WXWIN%;%CABAL_DIR%\wxc-%WXC_VERSION%\%GHC_VERSION%
Steps:
- Download wxWidgets 2.9.3 source
- Extract to C:\wxWidgets-2.9.3
- Build wxWidgets-2.9.3
I (who?) compiled it as follows: 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 mingw32-make -f makefile.gcc
- Download wx-config.exe (a new version for wxWidgets > 2.9) and copy it somewhere into your path, for instance via
cp wx-config.exe %CABAL_DIR%\bin
- Install the wxHaskell libraries
cabal install wxdirect cabal install wxc cabal install wxcore cabal install wx
DLLs
In order to run a wxHaskell application, the following wxWidgets DLLs must be in the search path:
(If you built wxWidgets in directory wxWidgets-2.9.3, the following files can be found in wxWidgets-2.9.3\lib\gcc_dll\ (change revision as needed))
- wxbase293u_gcc_custom.dll
- wxbase293u_net_gcc_custom.dll
- wxbase293u_xml_gcc_custom.dll
- wxmsw293u_adv_gcc_custom.dll
- wxmsw293u_aui_gcc_custom.dll
- wxmsw293u_core_gcc_custom.dll
- wxmsw293u_gl_gcc_custom.dll
- wxmsw293u_html_gcc_custom.dll
- wxmsw293u_propgrid_gcc_custom.dll
- wxmsw293u_ribbon_gcc_custom.dll
- wxmsw293u_richtext_gcc_custom.dll
- wxmsw293u_stc_gcc_custom.dll
- wxmsw293u_xrc_gcc_custom.dll
The following file can be found in directory wxc\dist\build\, after building package wxc in directory wxc:
- wxc.dll
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
- libaprutil-1.dll
These DLLs can be obtained by installing XAMPP; the DLLs are in the directories:
- xampp\perl\site\lib\auto\APR\UUID
- xampp\perl\bin
- xampp\apache\bin
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 |
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 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
.