Difference between revisions of "Windows"

From HaskellWiki
Jump to navigation Jump to search
(Changed "Direct downloads" to "Binary downloads"; added and updated some links)
Line 68: Line 68:
 
: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.
   
== Direct downloads ==
+
== Binary 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 last 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://www.haskell.org/alex/dist/alex-2.0.1-win32.zip Alex 2.0.1] (obsolete) [http://www.haskell.org/haskellwiki/Alex/ (website)] ;
+
[http://www.haskell.org/platform/windows.html The Haskell Platform] [[Haskell Platform | (website)]], contains GHC and a set of libraries and tools; [http://www.haskell.org/ghc/download_ghc_7_6_1#windows GHC 7.6.1] [[GHC | (HaskellWiki page)]]
  +
[http://www.haskell.org/alex/dist/alex-2.0.1-win32.zip Alex 2.0.1] (obsolete) [http://www.haskell.org/haskellwiki/Alex (website)] ;
 
[http://www.cs.york.ac.uk/fp/cpphs-1.2-win32.zip Cpphs 1.2] (obsolete) [http://haskell.org/cpphs/ (website)] ;
 
[http://www.cs.york.ac.uk/fp/cpphs-1.2-win32.zip Cpphs 1.2] (obsolete) [http://haskell.org/cpphs/ (website)] ;
 
[http://homepage.mac.com/kirby81_it/darcs/darcs-2.2.1-win1.zip Darcs 2.2.1 for Windows without Cygwin] ;
 
[http://homepage.mac.com/kirby81_it/darcs/darcs-2.2.1-win1.zip Darcs 2.2.1 for Windows without Cygwin] ;

Revision as of 07:26, 21 January 2013

Editors

Compilers/interpreters

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 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 have GHC >= 7.0.1, see Using shared libraries or Building and using Win32 DLLs

Libraries

  • GUI : Gtk2Hs - A binding of GTK in Haskell. Note this requires installing GTK on windows.
  • Win32 - low levelish bindings to Windows API. Comes with GHC and non-minimal hugs distribution. Win32 darcs repo
  • winerror: Error handling for foreign calls to the Windows API


Special tips and tricks for Windows

  • 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'.
  • 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; see the reversed dependencies lookup. However, sometimes, the dependency changes per platform; see for example the cabal file of the directory package.
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.

Binary downloads

Haskell

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

The Haskell Platform (website), contains GHC and a set of libraries and tools; GHC 7.6.1 (HaskellWiki page) Alex 2.0.1 (obsolete) (website) ; Cpphs 1.2 (obsolete) (website) ; Darcs 2.2.1 for Windows without Cygwin ; Drift (website) ; GHC 6.10.1 (website) ; Haddock 0.7 (obsolete) (website) ; Hat July 2006 (website) ; Happy 1.13 (obsolete) (website) ; HsColour 1.9 (website) ; WinHugs September 2006 (website) ; cURL 7.19.4 (website) ;


Development

CVS 1.11.22 (website) ; Python 2.4.3 (website) ; Scons (website) ; SVN 1.3.2 (website) ; TextPad 4.7.3 (website)

Shipping Installable Applications

* bamse lets you build windows installers for your Haskell app (MSI).
* Inno Setup is another tool to create windows installers.