Table of Contents
qtHaskell applications can be built like any other package based
Haskell programs, using either the -package qt
option for --make
option with ghc
command. Since the Haskell executables are rather large it is usually
worth applying the strip
utility which reduces their
size by about 50 percent.
The qhc
script used to facilitate the automated
building of the example files supplied with qtHaskell, may also prove useful
for building individual qtHaskell applications.
On Linux, the command
qhc a
[option
...]
is equivalent to
ghc --make -package qt -fglasgow-exts -O2 -o a a.hs
[option
...] -i.
strip a
For GHC 6.12.x or higher with dynamic linking enabled, the command
qhcd a
[option
...]
is equivalent to
ghc --make -package qt -fglasgow-exts -O2 -dynamic -o a a.hs
[option
...] -i.
strip a
On Windows, the command
qhc a
[option
...]
is equivalent to
ghc --make -package qt -fglasgow-exts -O2 -optl-Wl,-subsystem,windows
-o a a.hs
[option
...] -i.
strip a.exe
The option -optl-Wl,-subsystem,windows
is required
on Windows to prevent the application from opening a dos box if it is not run
from one. If it is used with a program which tries to write to the standard
output streams it will result in a runtime error, and hence should not be used
with console applications or for example when debugging gui applications.