https://wiki.haskell.org/api.php?action=feedcontributions&user=Artella.coding&feedformat=atomHaskellWiki - User contributions [en]2024-03-29T00:24:09ZUser contributionsMediaWiki 1.35.5https://wiki.haskell.org/index.php?title=Windows&diff=58380Windows2014-06-27T08:58:42Z<p>Artella.coding: minor edits to Quickstart section</p>
<hr />
<div>== Quickstart on Windows 7 ==<br />
<br />
For a minimal setup download the following : <br />
<br />
* [http://sourceforge.net/projects/msys2/ MSYS2] binaries<br />
* [http://www.haskell.org/ghc/download ghc] binaries<br />
* [http://www.haskell.org/cabal/download.html cabal] binaries<br />
<br />
Add the following to the path : <br />
<br />
* <hask>ghc/bin</hask> (should contain <hask>ghc.exe</hask> etc)<br />
* <hask>ghc/mingw/bin</hask> (should contain <hask>gcc.exe</hask> etc)<br />
* <hask>cabal/</hask> (should contain the cabal binary)<br />
<br />
If you launch <hask>msys2_shell.bat</hask> (as opposed to <hask>mingw32_shell.bat</hask> or <hask>mingw64_shell.bat</hask>) then make sure that the following environment variable is defined : <br />
<br />
* <hask>MSYSTEM=MINGW32</hask> or <hask>MSYSTEM=MINGW64</hask><br />
<br />
Then test by firing up either <hask>msys2_shell.bat</hask>, <hask>mingw32_shell.bat</hask>, or <hask>mingw64_shell.bat</hask> and then executing the following sequence of commands : <br />
<br />
* <hask><br />
mkdir test<br />
cd test<br />
cabal sandbox init<br />
cabal install hoogle<br />
</hask><br />
<br />
Note that the absence of the environment variables above will result in linker errors when building hoogle.<br />
<br />
== Editors ==<br />
<br />
* [http://www.e-texteditor.com/ E-Text Editor (TextMate for Windows)]<br />
* [http://www.textpad.com/ TextPad]<br />
* [http://ftp.gnu.org/gnu/emacs/windows/ Emacs], [http://www.vim.org/ Vi(m)], etc<br />
* [http://www.leksah.org/index.html Leksah]: Haskell IDE written in Haskell<br />
* [http://eclipsefp.sourceforge.net/ Eclipse]<br />
* [http://notepad-plus-plus.org/ Notepad++]<br />
* [http://www.sublimetext.com/ Sublime Text]<br />
* [http://www.pnotepad.org/ Programmer's Notepad]<br />
<br />
== Compilers/interpreters ==<br />
<br />
* [http://www.haskell.org/platform/ The Haskell Platform] is a combination of GHC and a set of blessed libraries<br />
* [[WinHugs]]<br />
* [[GHC]]: Special notes for Cygwin users - [http://www.haskell.org/ghc/docs/6.6/html/building/platforms.html] [http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-cygwin.html]<br />
* [http://code.google.com/p/winghci/ WinGhci], a GUI for GHCi (included in the Haskell Platform)<br />
<br />
== Tools for compilation ==<br />
<br />
* 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.<br />
<br />
* 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:<br />
Set C_INCLUDE_PATH=C:\usr\local\include;C:\usr\local\include\SDL<br />
:(It is advisable to use paths without spaces, because some scripts in the MinGW/MSYS environment have problems with spaces in paths.)<br><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.<br />
<br />
* Packages are often delivered as a .tar or .tar.gz file, see [[How to unpack a tar file in Windows]]<br />
<br />
* 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]<br />
: 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]<br />
<br />
== Libraries ==<br />
<br />
* GUI : [[wxHaskell]] - A binding of wxWidgets (formerly known as wxWindows) in Haskell. Note: see also [[wxHaskell/Windows]]<br />
<br />
* GUI : [[Gtk2Hs]] - A binding of GTK+ in Haskell. Note: this requires installing [http://www.gtk.org GTK+] on windows.<br />
<br />
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Win32 Win32] - low levelish bindings to Windows API. Comes with GHC and non-minimal Hugs distribution. [https://github.com/haskell/win32 Win32 git repo]<br />
<br />
* [[HDBC-ODBC under Windows]] for database access.<br />
<br />
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/winerror winerror]: Error handling for foreign calls to the Windows API<br />
<br />
== Special tips and tricks for Windows ==<br />
<br />
* 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.<br />
: Another option is [http://www.dependencywalker.com/ Dependency Walker]; this tool can also be used to find out, in which DLL a crash occurs.<br />
<br />
* [http://www.haskell.org/pipermail/haskell-cafe/2013-February/106436.html Terminal Win32/Building Haskeline/8.3 file issue] (Haskell-cafe)<br />
<br />
* darcs : http://wiki.darcs.net/WindowsConfiguration<br />
<br />
* Make sure your Haskell compiler (e.g. GHC) and tools are on your system path: http://www.computerhope.com/issues/ch000549.htm<br />
<br />
* Instead of using WinGHCi, one can also run GHCi in shell mode in Emacs &mdash; do 'M-x shell' in Emacs, then type 'ghci'.<br />
<br />
* 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.<br />
<br />
* If a package depends (either directly or indirectly) on the <code>unix</code> package, you cannot compile it on Windows.<br />
:A simple way to see, if a package X depends on <code>unix</code>, is giving the command:<br />
cabal install X --dry-run<br />
:This will list all packages that would be installed<br />
<br />
* 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.<br />
<br />
* 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.)<br />
<br />
* 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 <code>unix2dos</code> command (from the [http://sourceforge.net/projects/mingw/files/ mingw-utils] package). For more information, give command: <code>unix2dos --help</code><br />
:Note, that GHC can handle source files in Unix format.<br />
<br />
* To convert a set of files to MS-DOS format (note: this might damage binary files):<br />
::<code>C:\MSYS\1.0\bin\find . -type f -exec unix2dos {} ;</code><br />
: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.<br />
<br />
== Binary downloads ==<br />
<br />
=== Haskell ===<br />
<br />
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).<br />
<br />
* [http://www.haskell.org/platform/windows.html The Haskell Platform] [[Haskell Platform | (HaskellWiki page)]], contains GHC and a set of libraries and tools <br />
* [http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-i386-unknown-mingw32.tar.bz2 GHC 7.6.3 for Windows x86], [http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-x86_64-unknown-mingw32.tar.bz2 GHC 7.6.3 for Windows 64bit] [[GHC | (HaskellWiki page)]]<br />
* [http://leksah.org/download.html Leksah] [[Leksah | (HaskellWiki page)]]<br />
* [http://darcs.net/Binaries Darcs] [[Darcs | (HaskellWiki page)]]<br />
* [http://repetae.net/computer/haskell/DrIFT/drop/ Drift] [http://repetae.net/computer/haskell/DrIFT/ (website)] <br />
* [http://www.haskell.org/haddock/haddock-0.7-Win32.zip Haddock 0.7] (obsolete) [http://www.haskell.org/haddock/ (website)] <br />
* [http://www.haskell.org/happy/dist/1.13/happy-1-13.msi Happy 1.13] (obsolete) [http://www.haskell.org/happy/ (website)] <br />
* [ftp://ftp.cs.york.ac.uk/pub/haskell/contrib/hscolour-1.9.zip HsColour 1.9] [http://www.cs.york.ac.uk/fp/darcs/hscolour/ (website)] <br />
* [http://cvs.haskell.org/Hugs/pages/downloading.htm WinHugs September 2006] [http://www.haskell.org/hugs/ (website)] <br />
* [http://haskell.forkio.com/Home/curl-win32/curl-7.19.4-mingw32.zip?attredirects=0 cURL 7.19.4] [http://haskell.forkio.com/Home/curl-win32/ (website)]<br />
<br />
=== Development ===<br />
<br />
[https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows Setting up a Windows system for building GHC]<br />
<br />
== Shipping Installable Applications ==<br />
<br />
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bamse bamse] lets you build windows installers for your Haskell app (MSI).<br />
* [http://www.jrsoftware.org/isinfo.php Inno Setup] is another tool to create windows installers.<br />
* [http://wixtoolset.org/ WiX Toolset], builds Windows installation packages from XML source code<br />
* [http://zero-install.sourceforge.net/ Zero Install] creates packages for several platforms ("a decentralised cross-distribution software installation system")<br />
<br />
[[Category:OS]]</div>Artella.codinghttps://wiki.haskell.org/index.php?title=Windows&diff=58379Windows2014-06-27T08:53:05Z<p>Artella.coding: Updating development section</p>
<hr />
<div>== Quickstart on Windows 7 ==<br />
<br />
For a minimal setup : <br />
<br />
* Download MSYS2 from http://sourceforge.net/projects/msys2/<br />
* Download ghc binaries from http://www.haskell.org/ghc/download<br />
* Download cabal binaries from http://www.haskell.org/cabal/download.html<br />
<br />
Add the following to the path : <br />
<br />
* <hask>ghc/bin</hask> (should contain <hask>ghc.exe</hask> etc)<br />
* <hask>ghc/mingw/bin</hask> (should contain <hask>gcc.exe</hask> etc)<br />
* <hask>cabal/</hask> (should contain the cabal binary)<br />
<br />
If you launch <hask>msys2_shell.bat</hask> (as opposed to <hask>mingw32_shell.bat</hask> or <hask>mingw64_shell.bat</hask>) then make sure that the following environment variable is defined : <br />
<br />
* <hask>MSYSTEM=MINGW32</hask> or <hask>MSYSTEM=MINGW64</hask><br />
<br />
Then test by firing up either <hask>msys2_shell.bat</hask>, <hask>mingw32_shell.bat</hask>, or <hask>mingw64_shell.bat</hask> and then executing the following sequence of commands : <br />
<br />
* <hask><br />
mkdir test<br />
cd test<br />
cabal sandbox init<br />
cabal install hoogle<br />
</hask><br />
<br />
Note that the absence of the environment variables above will result in linker errors when building hoogle.<br />
<br />
== Editors ==<br />
<br />
* [http://www.e-texteditor.com/ E-Text Editor (TextMate for Windows)]<br />
* [http://www.textpad.com/ TextPad]<br />
* [http://ftp.gnu.org/gnu/emacs/windows/ Emacs], [http://www.vim.org/ Vi(m)], etc<br />
* [http://www.leksah.org/index.html Leksah]: Haskell IDE written in Haskell<br />
* [http://eclipsefp.sourceforge.net/ Eclipse]<br />
* [http://notepad-plus-plus.org/ Notepad++]<br />
* [http://www.sublimetext.com/ Sublime Text]<br />
* [http://www.pnotepad.org/ Programmer's Notepad]<br />
<br />
== Compilers/interpreters ==<br />
<br />
* [http://www.haskell.org/platform/ The Haskell Platform] is a combination of GHC and a set of blessed libraries<br />
* [[WinHugs]]<br />
* [[GHC]]: Special notes for Cygwin users - [http://www.haskell.org/ghc/docs/6.6/html/building/platforms.html] [http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-cygwin.html]<br />
* [http://code.google.com/p/winghci/ WinGhci], a GUI for GHCi (included in the Haskell Platform)<br />
<br />
== Tools for compilation ==<br />
<br />
* 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.<br />
<br />
* 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:<br />
Set C_INCLUDE_PATH=C:\usr\local\include;C:\usr\local\include\SDL<br />
:(It is advisable to use paths without spaces, because some scripts in the MinGW/MSYS environment have problems with spaces in paths.)<br><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.<br />
<br />
* Packages are often delivered as a .tar or .tar.gz file, see [[How to unpack a tar file in Windows]]<br />
<br />
* 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]<br />
: 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]<br />
<br />
== Libraries ==<br />
<br />
* GUI : [[wxHaskell]] - A binding of wxWidgets (formerly known as wxWindows) in Haskell. Note: see also [[wxHaskell/Windows]]<br />
<br />
* GUI : [[Gtk2Hs]] - A binding of GTK+ in Haskell. Note: this requires installing [http://www.gtk.org GTK+] on windows.<br />
<br />
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Win32 Win32] - low levelish bindings to Windows API. Comes with GHC and non-minimal Hugs distribution. [https://github.com/haskell/win32 Win32 git repo]<br />
<br />
* [[HDBC-ODBC under Windows]] for database access.<br />
<br />
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/winerror winerror]: Error handling for foreign calls to the Windows API<br />
<br />
== Special tips and tricks for Windows ==<br />
<br />
* 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.<br />
: Another option is [http://www.dependencywalker.com/ Dependency Walker]; this tool can also be used to find out, in which DLL a crash occurs.<br />
<br />
* [http://www.haskell.org/pipermail/haskell-cafe/2013-February/106436.html Terminal Win32/Building Haskeline/8.3 file issue] (Haskell-cafe)<br />
<br />
* darcs : http://wiki.darcs.net/WindowsConfiguration<br />
<br />
* Make sure your Haskell compiler (e.g. GHC) and tools are on your system path: http://www.computerhope.com/issues/ch000549.htm<br />
<br />
* Instead of using WinGHCi, one can also run GHCi in shell mode in Emacs &mdash; do 'M-x shell' in Emacs, then type 'ghci'.<br />
<br />
* 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.<br />
<br />
* If a package depends (either directly or indirectly) on the <code>unix</code> package, you cannot compile it on Windows.<br />
:A simple way to see, if a package X depends on <code>unix</code>, is giving the command:<br />
cabal install X --dry-run<br />
:This will list all packages that would be installed<br />
<br />
* 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.<br />
<br />
* 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.)<br />
<br />
* 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 <code>unix2dos</code> command (from the [http://sourceforge.net/projects/mingw/files/ mingw-utils] package). For more information, give command: <code>unix2dos --help</code><br />
:Note, that GHC can handle source files in Unix format.<br />
<br />
* To convert a set of files to MS-DOS format (note: this might damage binary files):<br />
::<code>C:\MSYS\1.0\bin\find . -type f -exec unix2dos {} ;</code><br />
: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.<br />
<br />
== Binary downloads ==<br />
<br />
=== Haskell ===<br />
<br />
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).<br />
<br />
* [http://www.haskell.org/platform/windows.html The Haskell Platform] [[Haskell Platform | (HaskellWiki page)]], contains GHC and a set of libraries and tools <br />
* [http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-i386-unknown-mingw32.tar.bz2 GHC 7.6.3 for Windows x86], [http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-x86_64-unknown-mingw32.tar.bz2 GHC 7.6.3 for Windows 64bit] [[GHC | (HaskellWiki page)]]<br />
* [http://leksah.org/download.html Leksah] [[Leksah | (HaskellWiki page)]]<br />
* [http://darcs.net/Binaries Darcs] [[Darcs | (HaskellWiki page)]]<br />
* [http://repetae.net/computer/haskell/DrIFT/drop/ Drift] [http://repetae.net/computer/haskell/DrIFT/ (website)] <br />
* [http://www.haskell.org/haddock/haddock-0.7-Win32.zip Haddock 0.7] (obsolete) [http://www.haskell.org/haddock/ (website)] <br />
* [http://www.haskell.org/happy/dist/1.13/happy-1-13.msi Happy 1.13] (obsolete) [http://www.haskell.org/happy/ (website)] <br />
* [ftp://ftp.cs.york.ac.uk/pub/haskell/contrib/hscolour-1.9.zip HsColour 1.9] [http://www.cs.york.ac.uk/fp/darcs/hscolour/ (website)] <br />
* [http://cvs.haskell.org/Hugs/pages/downloading.htm WinHugs September 2006] [http://www.haskell.org/hugs/ (website)] <br />
* [http://haskell.forkio.com/Home/curl-win32/curl-7.19.4-mingw32.zip?attredirects=0 cURL 7.19.4] [http://haskell.forkio.com/Home/curl-win32/ (website)]<br />
<br />
=== Development ===<br />
<br />
[https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows Setting up a Windows system for building GHC]<br />
<br />
== Shipping Installable Applications ==<br />
<br />
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bamse bamse] lets you build windows installers for your Haskell app (MSI).<br />
* [http://www.jrsoftware.org/isinfo.php Inno Setup] is another tool to create windows installers.<br />
* [http://wixtoolset.org/ WiX Toolset], builds Windows installation packages from XML source code<br />
* [http://zero-install.sourceforge.net/ Zero Install] creates packages for several platforms ("a decentralised cross-distribution software installation system")<br />
<br />
[[Category:OS]]</div>Artella.codinghttps://wiki.haskell.org/index.php?title=Windows&diff=58372Windows2014-06-26T15:58:34Z<p>Artella.coding: clarifying windows installations instructions</p>
<hr />
<div>== Quickstart on Windows 7 ==<br />
<br />
For a minimal setup : <br />
<br />
* Download MSYS2 from http://sourceforge.net/projects/msys2/<br />
* Download ghc binaries from http://www.haskell.org/ghc/download<br />
* Download cabal binaries from http://www.haskell.org/cabal/download.html<br />
<br />
Add the following to the path : <br />
<br />
* <hask>ghc/bin</hask> (should contain <hask>ghc.exe</hask> etc)<br />
* <hask>ghc/mingw/bin</hask> (should contain <hask>gcc.exe</hask> etc)<br />
* <hask>cabal/</hask> (should contain the cabal binary)<br />
<br />
If you launch <hask>msys2_shell.bat</hask> (as opposed to <hask>mingw32_shell.bat</hask> or <hask>mingw64_shell.bat</hask>) then make sure that the following environment variable is defined : <br />
<br />
* <hask>MSYSTEM=MINGW32</hask> or <hask>MSYSTEM=MINGW64</hask><br />
<br />
Then test by firing up either <hask>msys2_shell.bat</hask>, <hask>mingw32_shell.bat</hask>, or <hask>mingw64_shell.bat</hask> and then executing the following sequence of commands : <br />
<br />
* <hask><br />
mkdir test<br />
cd test<br />
cabal sandbox init<br />
cabal install hoogle<br />
</hask><br />
<br />
Note that the absence of the environment variables above will result in linker errors when building hoogle.<br />
<br />
== Editors ==<br />
<br />
* [http://www.e-texteditor.com/ E-Text Editor (TextMate for Windows)]<br />
* [http://www.textpad.com/ TextPad]<br />
* [http://ftp.gnu.org/gnu/emacs/windows/ Emacs], [http://www.vim.org/ Vi(m)], etc<br />
* [http://www.leksah.org/index.html Leksah]: Haskell IDE written in Haskell<br />
* [http://eclipsefp.sourceforge.net/ Eclipse]<br />
* [http://notepad-plus-plus.org/ Notepad++]<br />
* [http://www.sublimetext.com/ Sublime Text]<br />
* [http://www.pnotepad.org/ Programmer's Notepad]<br />
<br />
== Compilers/interpreters ==<br />
<br />
* [http://www.haskell.org/platform/ The Haskell Platform] is a combination of GHC and a set of blessed libraries<br />
* [[WinHugs]]<br />
* [[GHC]]: Special notes for Cygwin users - [http://www.haskell.org/ghc/docs/6.6/html/building/platforms.html] [http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-cygwin.html]<br />
* [http://code.google.com/p/winghci/ WinGhci], a GUI for GHCi (included in the Haskell Platform)<br />
<br />
== Tools for compilation ==<br />
<br />
* 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.<br />
<br />
* 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:<br />
Set C_INCLUDE_PATH=C:\usr\local\include;C:\usr\local\include\SDL<br />
:(It is advisable to use paths without spaces, because some scripts in the MinGW/MSYS environment have problems with spaces in paths.)<br><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.<br />
<br />
* Packages are often delivered as a .tar or .tar.gz file, see [[How to unpack a tar file in Windows]]<br />
<br />
* 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]<br />
: 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]<br />
<br />
== Libraries ==<br />
<br />
* GUI : [[wxHaskell]] - A binding of wxWidgets (formerly known as wxWindows) in Haskell. Note: see also [[wxHaskell/Windows]]<br />
<br />
* GUI : [[Gtk2Hs]] - A binding of GTK+ in Haskell. Note: this requires installing [http://www.gtk.org GTK+] on windows.<br />
<br />
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Win32 Win32] - low levelish bindings to Windows API. Comes with GHC and non-minimal Hugs distribution. [https://github.com/haskell/win32 Win32 git repo]<br />
<br />
* [[HDBC-ODBC under Windows]] for database access.<br />
<br />
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/winerror winerror]: Error handling for foreign calls to the Windows API<br />
<br />
== Special tips and tricks for Windows ==<br />
<br />
* 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.<br />
: Another option is [http://www.dependencywalker.com/ Dependency Walker]; this tool can also be used to find out, in which DLL a crash occurs.<br />
<br />
* [http://www.haskell.org/pipermail/haskell-cafe/2013-February/106436.html Terminal Win32/Building Haskeline/8.3 file issue] (Haskell-cafe)<br />
<br />
* darcs : http://wiki.darcs.net/WindowsConfiguration<br />
<br />
* Make sure your Haskell compiler (e.g. GHC) and tools are on your system path: http://www.computerhope.com/issues/ch000549.htm<br />
<br />
* Instead of using WinGHCi, one can also run GHCi in shell mode in Emacs &mdash; do 'M-x shell' in Emacs, then type 'ghci'.<br />
<br />
* 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.<br />
<br />
* If a package depends (either directly or indirectly) on the <code>unix</code> package, you cannot compile it on Windows.<br />
:A simple way to see, if a package X depends on <code>unix</code>, is giving the command:<br />
cabal install X --dry-run<br />
:This will list all packages that would be installed<br />
<br />
* 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.<br />
<br />
* 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.)<br />
<br />
* 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 <code>unix2dos</code> command (from the [http://sourceforge.net/projects/mingw/files/ mingw-utils] package). For more information, give command: <code>unix2dos --help</code><br />
:Note, that GHC can handle source files in Unix format.<br />
<br />
* To convert a set of files to MS-DOS format (note: this might damage binary files):<br />
::<code>C:\MSYS\1.0\bin\find . -type f -exec unix2dos {} ;</code><br />
: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.<br />
<br />
== Binary downloads ==<br />
<br />
=== Haskell ===<br />
<br />
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).<br />
<br />
* [http://www.haskell.org/platform/windows.html The Haskell Platform] [[Haskell Platform | (HaskellWiki page)]], contains GHC and a set of libraries and tools <br />
* [http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-i386-unknown-mingw32.tar.bz2 GHC 7.6.3 for Windows x86], [http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-x86_64-unknown-mingw32.tar.bz2 GHC 7.6.3 for Windows 64bit] [[GHC | (HaskellWiki page)]]<br />
* [http://leksah.org/download.html Leksah] [[Leksah | (HaskellWiki page)]]<br />
* [http://darcs.net/Binaries Darcs] [[Darcs | (HaskellWiki page)]]<br />
* [http://repetae.net/computer/haskell/DrIFT/drop/ Drift] [http://repetae.net/computer/haskell/DrIFT/ (website)] <br />
* [http://www.haskell.org/haddock/haddock-0.7-Win32.zip Haddock 0.7] (obsolete) [http://www.haskell.org/haddock/ (website)] <br />
* [http://www.haskell.org/happy/dist/1.13/happy-1-13.msi Happy 1.13] (obsolete) [http://www.haskell.org/happy/ (website)] <br />
* [ftp://ftp.cs.york.ac.uk/pub/haskell/contrib/hscolour-1.9.zip HsColour 1.9] [http://www.cs.york.ac.uk/fp/darcs/hscolour/ (website)] <br />
* [http://cvs.haskell.org/Hugs/pages/downloading.htm WinHugs September 2006] [http://www.haskell.org/hugs/ (website)] <br />
* [http://haskell.forkio.com/Home/curl-win32/curl-7.19.4-mingw32.zip?attredirects=0 cURL 7.19.4] [http://haskell.forkio.com/Home/curl-win32/ (website)]<br />
<br />
=== Development ===<br />
<br />
[ftp://ftp.gnu.org/gnu/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip CVS 1.11.22] [http://www.nongnu.org/cvs/ (website)] ; [http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi Python 2.4.3] [http://www.python.org/ (website)] ; [http://sourceforge.net/projects/scons/files/ Scons] [http://www.scons.org/ (website)] ; [http://subversion.tigris.org/files/documents/15/32856/svn-1.3.2-setup.exe SVN 1.3.2] [http://subversion.tigris.org/ (website)] ; [http://www.textpad.com/download/ TextPad] [http://www.textpad.com/ (website)]<br />
<br />
== Shipping Installable Applications ==<br />
<br />
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bamse bamse] lets you build windows installers for your Haskell app (MSI).<br />
* [http://www.jrsoftware.org/isinfo.php Inno Setup] is another tool to create windows installers.<br />
* [http://wixtoolset.org/ WiX Toolset], builds Windows installation packages from XML source code<br />
* [http://zero-install.sourceforge.net/ Zero Install] creates packages for several platforms ("a decentralised cross-distribution software installation system")<br />
<br />
[[Category:OS]]</div>Artella.codinghttps://wiki.haskell.org/index.php?title=Windows&diff=58365Windows2014-06-25T10:32:25Z<p>Artella.coding: Adding installation instructions for windows 7</p>
<hr />
<div>== Quickstart on Windows 7 ==<br />
<br />
For a minimal setup : <br />
<br />
* Download MSYS2 from http://sourceforge.net/projects/msys2/<br />
* Download ghc binaries from http://www.haskell.org/ghc/download<br />
* Download cabal binaries from http://www.haskell.org/cabal/download.html<br />
<br />
Add the following to path : <br />
<br />
* <hask>ghc/bin</hask> (should contain <hask>ghc.exe</hask> etc)<br />
* <hask>ghc/mingw/bin</hask> (should contain <hask>gcc.exe</hask> etc)<br />
* <hask>cabal/</hask> (should contain the cabal binary)<br />
<br />
And make sure that the following environment variable is <br />
defined : <br />
<br />
* <hask>MSYSTEM=MINGW32</hask> or <hask>MSYSTEM=MINGW64</hask><br />
<br />
Then test by firing up the msys shell and doing : <br />
<br />
* <hask>cabal install hoogle</hask><br />
<br />
== Editors ==<br />
<br />
* [http://www.e-texteditor.com/ E-Text Editor (TextMate for Windows)]<br />
* [http://www.textpad.com/ TextPad]<br />
* [http://ftp.gnu.org/gnu/emacs/windows/ Emacs], [http://www.vim.org/ Vi(m)], etc<br />
* [http://www.leksah.org/index.html Leksah]: Haskell IDE written in Haskell<br />
* [http://eclipsefp.sourceforge.net/ Eclipse]<br />
* [http://notepad-plus-plus.org/ Notepad++]<br />
* [http://www.sublimetext.com/ Sublime Text]<br />
* [http://www.pnotepad.org/ Programmer's Notepad]<br />
<br />
== Compilers/interpreters ==<br />
<br />
* [http://www.haskell.org/platform/ The Haskell Platform] is a combination of GHC and a set of blessed libraries<br />
* [[WinHugs]]<br />
* [[GHC]]: Special notes for Cygwin users - [http://www.haskell.org/ghc/docs/6.6/html/building/platforms.html] [http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-cygwin.html]<br />
* [http://code.google.com/p/winghci/ WinGhci], a GUI for GHCi (included in the Haskell Platform)<br />
<br />
== Tools for compilation ==<br />
<br />
* 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.<br />
<br />
* 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:<br />
Set C_INCLUDE_PATH=C:\usr\local\include;C:\usr\local\include\SDL<br />
:(It is advisable to use paths without spaces, because some scripts in the MinGW/MSYS environment have problems with spaces in paths.)<br><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.<br />
<br />
* Packages are often delivered as a .tar or .tar.gz file, see [[How to unpack a tar file in Windows]]<br />
<br />
* 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]<br />
: 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]<br />
<br />
== Libraries ==<br />
<br />
* GUI : [[wxHaskell]] - A binding of wxWidgets (formerly known as wxWindows) in Haskell. Note: see also [[wxHaskell/Windows]]<br />
<br />
* GUI : [[Gtk2Hs]] - A binding of GTK+ in Haskell. Note: this requires installing [http://www.gtk.org GTK+] on windows.<br />
<br />
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Win32 Win32] - low levelish bindings to Windows API. Comes with GHC and non-minimal Hugs distribution. [https://github.com/haskell/win32 Win32 git repo]<br />
<br />
* [[HDBC-ODBC under Windows]] for database access.<br />
<br />
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/winerror winerror]: Error handling for foreign calls to the Windows API<br />
<br />
== Special tips and tricks for Windows ==<br />
<br />
* 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.<br />
: Another option is [http://www.dependencywalker.com/ Dependency Walker]; this tool can also be used to find out, in which DLL a crash occurs.<br />
<br />
* [http://www.haskell.org/pipermail/haskell-cafe/2013-February/106436.html Terminal Win32/Building Haskeline/8.3 file issue] (Haskell-cafe)<br />
<br />
* darcs : http://wiki.darcs.net/WindowsConfiguration<br />
<br />
* Make sure your Haskell compiler (e.g. GHC) and tools are on your system path: http://www.computerhope.com/issues/ch000549.htm<br />
<br />
* Instead of using WinGHCi, one can also run GHCi in shell mode in Emacs &mdash; do 'M-x shell' in Emacs, then type 'ghci'.<br />
<br />
* 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.<br />
<br />
* If a package depends (either directly or indirectly) on the <code>unix</code> package, you cannot compile it on Windows.<br />
:A simple way to see, if a package X depends on <code>unix</code>, is giving the command:<br />
cabal install X --dry-run<br />
:This will list all packages that would be installed<br />
<br />
* 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.<br />
<br />
* 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.)<br />
<br />
* 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 <code>unix2dos</code> command (from the [http://sourceforge.net/projects/mingw/files/ mingw-utils] package). For more information, give command: <code>unix2dos --help</code><br />
:Note, that GHC can handle source files in Unix format.<br />
<br />
* To convert a set of files to MS-DOS format (note: this might damage binary files):<br />
::<code>C:\MSYS\1.0\bin\find . -type f -exec unix2dos {} ;</code><br />
: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.<br />
<br />
== Binary downloads ==<br />
<br />
=== Haskell ===<br />
<br />
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).<br />
<br />
* [http://www.haskell.org/platform/windows.html The Haskell Platform] [[Haskell Platform | (HaskellWiki page)]], contains GHC and a set of libraries and tools <br />
* [http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-i386-unknown-mingw32.tar.bz2 GHC 7.6.3 for Windows x86], [http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-x86_64-unknown-mingw32.tar.bz2 GHC 7.6.3 for Windows 64bit] [[GHC | (HaskellWiki page)]]<br />
* [http://leksah.org/download.html Leksah] [[Leksah | (HaskellWiki page)]]<br />
* [http://darcs.net/Binaries Darcs] [[Darcs | (HaskellWiki page)]]<br />
* [http://repetae.net/computer/haskell/DrIFT/drop/ Drift] [http://repetae.net/computer/haskell/DrIFT/ (website)] <br />
* [http://www.haskell.org/haddock/haddock-0.7-Win32.zip Haddock 0.7] (obsolete) [http://www.haskell.org/haddock/ (website)] <br />
* [http://www.haskell.org/happy/dist/1.13/happy-1-13.msi Happy 1.13] (obsolete) [http://www.haskell.org/happy/ (website)] <br />
* [ftp://ftp.cs.york.ac.uk/pub/haskell/contrib/hscolour-1.9.zip HsColour 1.9] [http://www.cs.york.ac.uk/fp/darcs/hscolour/ (website)] <br />
* [http://cvs.haskell.org/Hugs/pages/downloading.htm WinHugs September 2006] [http://www.haskell.org/hugs/ (website)] <br />
* [http://haskell.forkio.com/Home/curl-win32/curl-7.19.4-mingw32.zip?attredirects=0 cURL 7.19.4] [http://haskell.forkio.com/Home/curl-win32/ (website)]<br />
<br />
=== Development ===<br />
<br />
[ftp://ftp.gnu.org/gnu/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip CVS 1.11.22] [http://www.nongnu.org/cvs/ (website)] ; [http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi Python 2.4.3] [http://www.python.org/ (website)] ; [http://sourceforge.net/projects/scons/files/ Scons] [http://www.scons.org/ (website)] ; [http://subversion.tigris.org/files/documents/15/32856/svn-1.3.2-setup.exe SVN 1.3.2] [http://subversion.tigris.org/ (website)] ; [http://www.textpad.com/download/ TextPad] [http://www.textpad.com/ (website)]<br />
<br />
== Shipping Installable Applications ==<br />
<br />
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bamse bamse] lets you build windows installers for your Haskell app (MSI).<br />
* [http://www.jrsoftware.org/isinfo.php Inno Setup] is another tool to create windows installers.<br />
* [http://wixtoolset.org/ WiX Toolset], builds Windows installation packages from XML source code<br />
* [http://zero-install.sourceforge.net/ Zero Install] creates packages for several platforms ("a decentralised cross-distribution software installation system")<br />
<br />
[[Category:OS]]</div>Artella.coding