* [http://code.google.com/p/winghci/ WinGhci], a GUI for GHCi (included in the Haskell Platform)

== Tools for compilation ==

== Tools for compilation ==

Line 21:

Line 21:

* As some of the packages contain Unix/Linux specific scripts/commands, you need [http://www.mingw.org/ MinGW] and [http://www.mingw.org/wiki/msys MSYS] to simulate a Unix environment. In some cases you need [http://www.cygwin.com/ Cygwin] instead. If you use [http://code.google.com/p/msysgit/ msysgit] on Windows already, all you need to do is add MinGW to your path.

* As some of the packages contain Unix/Linux specific scripts/commands, you need [http://www.mingw.org/ MinGW] and [http://www.mingw.org/wiki/msys MSYS] to simulate a Unix environment. In some cases you need [http://www.cygwin.com/ Cygwin] instead. If you use [http://code.google.com/p/msysgit/ msysgit] on Windows already, all you need to do is add MinGW to your path.

−

* If you need to link to C-software, [http://en.wikipedia.org/wiki/Environment_variable#DOS_and_Windows define an environment variable] C_INCLUDE_PATH that lists the directories where the header files can be found. For linking the libraries you need to define an environment variable LIBRARY_PATH as well, listing the directories where .a and .lib files can be found. In case C++ software must be compiled, define CPLUS_INCLUDE_PATH to list the directories with C++ header files.

+

* If you need to link to C-software, [http://en.wikipedia.org/wiki/Environment_variable#DOS.2C_OS.2F2_and_Windows_.28Command_Prompt.29 define environment variable] C_INCLUDE_PATH that lists the directories where the header files can be found, for example:

+

Set C_INCLUDE_PATH=C:\usr\local\include;C:\usr\local\include\SDL

+

:(It is advisable to use paths without spaces, because some scripts in the MinGW/MSYS environment have problems with spaces in paths.)<br>

+

:For linking the libraries you need to define environment variable LIBRARY_PATH as well, listing the directories where .a and .lib files can be found. In case C++ software must be compiled, define CPLUS_INCLUDE_PATH to list the directories with C++ header files.

* Packages are often delivered as a .tar or .tar.gz file, see [[How to unpack a tar file in windows]]

* Packages are often delivered as a .tar or .tar.gz file, see [[How to unpack a tar file in windows]]

−

* To work with/produce DLL files, you need dlltool.exe, from the [http://sourceforge.net/projects/mingw/files/ mingw-binutils] package and pexports.exe from the [http://sourceforge.net/projects/mingw/files/ mingw-utils] package. For more information see [http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gnu-binutils/dlltool.html the dlltool manual] and [http://www.willus.com/mingw/yongweiwu_stdcall.html Stdcall and DLL tools of MSVC and MinGW]

+

* To work with/produce DLL files with GHC < 7.0.1, you need dlltool.exe, from the [http://sourceforge.net/projects/mingw/files/ mingw-binutils] package and pexports.exe from the [http://sourceforge.net/projects/mingw/files/ mingw-utils] package. For more information see [http://www.cse.yorku.ca/tdb/_doc.php/userg/man/name/dlltool/section/1 the dlltool manual] and [http://www.willus.com/mingw/yongweiwu_stdcall.html Stdcall and DLL tools of MSVC and MinGW]

+

: If you have GHC >= 7.0.1, see [http://www.haskell.org/ghc/docs/latest/html/users_guide/using-shared-libs.html Using shared libraries] or [http://www.haskell.org/ghc/docs/latest/html/users_guide/win32-dlls.html Building and using Win32 DLLs]

== Libraries ==

== Libraries ==

−

* GUI : [[wxHaskell]] - A binding of wxWidgets (formerly known as wxWindows) in Haskell. Note, see also [[wxHaskell/Building]]

+

* GUI : [[wxHaskell]] - A binding of wxWidgets (formerly known as wxWindows) in Haskell. Note: see also [[wxHaskell/Windows]]

* If there are DLLs missing from your environment, 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.

* Make sure your Haskell compiler (e.g. GHC) and tools are on your system path: http://www.computerhope.com/issues/ch000549.htm

* Make sure your Haskell compiler (e.g. GHC) and tools are on your system path: http://www.computerhope.com/issues/ch000549.htm

−

* GHCi: Using GHCi from a Win32 console is not everyones cup of tea. Using it from within shell mode in Emacs sucks a lot less - do 'M-x shell' in emacs, then type 'ghci'.

+

* Instead of using WinGHCi, one can also run GHCi in shell mode in Emacs &mdash; do 'M-x shell' in Emacs, then type 'ghci'.

−

* GHCi on Cygwin: When running GHC under a Cygwin shell on Windows, Ctrl-C sometimes doesn't work. A workaround is to use the rlwrap program to invoke ghci : In addition to proper Ctrl-C, you also get emacs (or vi) key bindings and command history across sessions, which saves you a load of typing.

+

* GHCi on Cygwin: When running GHC under a Cygwin shell on Windows, Ctrl-C sometimes doesn't work. A workaround is to use the rlwrap program to invoke GHCi : In addition to proper Ctrl-C, you also get Emacs (or vi) key bindings and command history across sessions, which saves you a load of typing.

−

* If a package depends (either directly or indirectly) on the <code>unix</code> package, you cannot compile it on Windows; see the [http://bifunctor.homelinux.net/~roel/cgi-bin/hackage-scripts/revdeps/unix reversed dependencies list]. However, sometimes, the dependency changes per platform; see for example the [http://hackage.haskell.org/packages/archive/directory/1.0.1.0/directory.cabal cabal file] of the <code>directory</code> package

+

* If a package depends (either directly or indirectly) on the <code>unix</code> package, you cannot compile it on Windows.

+

:A simple way to see, if a package X depends on <code>unix</code>, is giving the command:

+

cabal install X --dry-run

+

:This will list all packages that would be installed

−

* If you are missing or need to distribute libraries with an application, the correct place to put them is *NOT* in \WINDOWS\System32 as once was the practice in the early days of Windows. All sane applications/installers keep their own private dependencies in the application directory. Eg, if the user has chosen to install your application to C:\Program Files\Foo then it is best to install any DLLs in the same location.

+

* If you are missing or need to distribute libraries with an application, the correct place to put them is *NOT* in \WINDOWS\System32 as once was the practice in the early days of Windows. All sane applications/installers keep their own private dependencies in the application directory. E.g., if the user has chosen to install your application to C:\Program Files\Foo then it is best to install any DLLs in the same location.

* When compiling a program with GUI, use the compiler option -optl-mwindows to prevent a DOS-shell being displayed behind your GUI. (This passes the option -mwindows to the linker.)

* When compiling a program with GUI, use the compiler option -optl-mwindows to prevent a DOS-shell being displayed behind your GUI. (This passes the option -mwindows to the linker.)

Line 63:

Line 74:

:Note: the <code>find</code> command included in MSYS is different from the MS-DOS <code>find</code> command, therefore, you need to specify the entire path to this command.

:Note: the <code>find</code> command included in MSYS is different from the MS-DOS <code>find</code> command, therefore, you need to specify the entire path to this command.

−

+

== Binary downloads ==

−

+

−

== Direct downloads ==

+

=== Haskell ===

=== Haskell ===

−

Below a list of binary packages packages for Windows. To be sure you get the last version of each, it is best to download the source from [http://hackage.haskell.org/packages/archive/pkg-list.html Hackage] and compile.

+

Below a list of binary packages for Windows. To be sure you get the most recent version of each, it is best to download the source from [http://hackage.haskell.org/packages/archive/pkg-list.html Hackage] and compile (except for the Haskell Platform).

[http://testgrid.allmydata.org:3567/uri/URI:DIR2-RO:bminllzdrpadzvyt54cbhotnam:jqafknaedfksjjq3xmkfpe4g4ppklctw3xwpszufol7zddyx5agq/darcsdir-w32-2.2.0.zip Darcs 2.2.0 for Windows without Cygwin, with SSH support files] ;

2 Compilers/interpreters

3 Tools for compilation

As some of the packages contain Unix/Linux specific scripts/commands, you need MinGW and MSYS to simulate a Unix environment. In some cases you need Cygwin instead. If you use msysgit on Windows already, all you need to do is add MinGW to your path.

If you need to link to C-software, define environment variable C_INCLUDE_PATH that lists the directories where the header files can be found, for example:

Set C_INCLUDE_PATH=C:\usr\local\include;C:\usr\local\include\SDL

(It is advisable to use paths without spaces, because some scripts in the MinGW/MSYS environment have problems with spaces in paths.)

For linking the libraries you need to define environment variable LIBRARY_PATH as well, listing the directories where .a and .lib files can be found. In case C++ software must be compiled, define CPLUS_INCLUDE_PATH to list the directories with C++ header files.

5 Special tips and tricks for Windows

If there are DLLs missing from your environment, 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.

Instead of using WinGHCi, one can also run GHCi in shell mode in Emacs — do 'M-x shell' in Emacs, then type 'ghci'.

GHCi on Cygwin: When running GHC under a Cygwin shell on Windows, Ctrl-C sometimes doesn't work. A workaround is to use the rlwrap program to invoke GHCi : In addition to proper Ctrl-C, you also get Emacs (or vi) key bindings and command history across sessions, which saves you a load of typing.

If a package depends (either directly or indirectly) on the unix package, you cannot compile it on Windows.

A simple way to see, if a package X depends on unix, is giving the command:

cabal install X --dry-run

This will list all packages that would be installed

If you are missing or need to distribute libraries with an application, the correct place to put them is *NOT* in \WINDOWS\System32 as once was the practice in the early days of Windows. All sane applications/installers keep their own private dependencies in the application directory. E.g., if the user has chosen to install your application to C:\Program Files\Foo then it is best to install any DLLs in the same location.

When compiling a program with GUI, use the compiler option -optl-mwindows to prevent a DOS-shell being displayed behind your GUI. (This passes the option -mwindows to the linker.)

Source files from Unix(-like) systems have lines terminated with Line Feed only; if your favorite editor cannot handle this, you can convert the files to MS-DOS format with the unix2dos command (from the mingw-utils package). For more information, give command: unix2dos --help

Note, that GHC can handle source files in Unix format.

To convert a set of files to MS-DOS format (note: this might damage binary files):

C:\MSYS\1.0\bin\find . -type f -exec unix2dos {} ;

Note: the find command included in MSYS is different from the MS-DOS find command, therefore, you need to specify the entire path to this command.

6 Binary downloads

6.1 Haskell

Below a list of binary packages for Windows. To be sure you get the most recent version of each, it is best to download the source from Hackage and compile (except for the Haskell Platform).