[Haskell-beginners] Getting Gtk2Hs working in windows

Kyle Murphy orclev at gmail.com
Fri Mar 18 23:49:37 CET 2011


I'm trying to follow the instructions provided on
http://www.haskell.org/haskellwiki/Gtk2Hs to install Gtk2Hs in Windows 7 (64
bit) and running into problems.
Originally I was trying to get wxHaskell installed, but it kept crashing
trying to build the monolithic library due to an apparent bug in the latest
port of GCC, so after talking with some of the people in #haskell I was
advised that Gtk2Hs was better supported and might be easier to get working.
For the most part, that appears to be true but I (as well as several others
it seems) am running into a problem where cabal can't seem to find quite a
few of the Gtk+ libraries (specifically z, cairo, gobject, glib, and intl).
Near as I can tell everything should be functioning, and running pkg-config
--modversion glib-2.0 outputs "2.20.3" so at least pkg-config seems to be
able to find glib. Looking in the Gtk+\lib\pkgconfig folder I see pc files
for everything but z and intl listed. Running cabal install
gtk2hs-buildtools also succeeds, it's only when I get to the cabal install
gtk step that things fail.

cmd console output for the usual environment variables:

INCLUDE: C:\libxml\include;C:\Program Files (x86)\Gtk+\include
LIB: C:\libxml\lib;C:\Program Files (x86)\Gtk+\lib
PKG_CONFIG_PATH: C:\libxml\lib\pkgconfig;C:\Program Files
(x86)\Gtk+\lib\pkgconfig

I trimmed the PATH output below for everyones sanity. The vast majority was
stuff in the Windows folder or one of dozens of entries dumped in there by
some version or other of Java.

PATH:
C:\Program Files (x86)\Haskell\bin;
C:\Program Files (x86)\Haskell Platform\2011.2.0.0\lib\extralibs\bin;
C:\Program Files (x86)\Haskell Platform\2011.2.0.0\bin;
C:\MinGW\bin;
C:\Users\Kyle\AppData\Roaming\cabal\bin;
C:\Program Files (x86)\Haskell\bin;
C:\Program Files (x86)\Gtk+\bin

The exact error I'm getting when building is the following:
C:\Users\Kyle>cabal install gtk
Warning: The package list for 'hackage.haskell.org' is 23 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
C:\Users\Kyle\AppData\Local\Temp\cairo-0.12.05760\cairo-0.12.0\Gtk2HsSetup.hs:25:2:
warning: #warning Setup.hs is guessing the version of Cabal. If
compilationof Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal version
1.x.0 when building (prefixed by --ghc-option= when using the 'cabal'
command)
[1 of 2] Compiling Gtk2HsSetup      (
C:\Users\Kyle\AppData\Local\Temp\cairo-0.12.05760\cairo-0.12.0\Gtk2HsSetup.hs,
C:\Users\Kyle\AppData\Local\Temp\cairo-0.12.05760\cairo-0.12.0\dist\setup\Gtk2HsSetup.o
)
[2 of 2] Compiling Main             (
C:\Users\Kyle\AppData\Local\Temp\cairo-0.12.05760\cairo-0.12.0\Setup.hs,
C:\Users\Kyle\AppData\Local\Temp\cairo-0.12.05760\cairo-0.12.0\dist\setup\Main.o
)
Linking
C:\Users\Kyle\AppData\Local\Temp\cairo-0.12.05760\cairo-0.12.0\dist\setup\setup.exe
...
Configuring cairo-0.12.0...
setup.exe: Missing dependencies on foreign libraries:
* Missing C libraries: z, cairo
This problem can usually be solved by installing the system packages that
provide these libraries (you may need the "-dev" versions). If the libraries
are already installed but in a non-standard location then you can use the
flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
C:\Users\Kyle\AppData\Local\Temp\glib-0.12.05760\glib-0.12.0\Gtk2HsSetup.hs:25:2:
warning: #warning Setup.hs is guessing the version of Cabal. If compilation
of Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal version 1.x.0 when
building (prefixed by --ghc-option= when using the 'cabal' command)
[1 of 2] Compiling Gtk2HsSetup      (
C:\Users\Kyle\AppData\Local\Temp\glib-0.12.05760\glib-0.12.0\Gtk2HsSetup.hs,
C:\Users\Kyle\AppData\Local\Temp\glib-0.12.05760\glib-0.12.0\dist\setup\Gtk2HsSetup.o
)
[2 of 2] Compiling Main             (
C:\Users\Kyle\AppData\Local\Temp\glib-0.12.05760\glib-0.12.0\Setup.hs,
C:\Users\Kyle\AppData\Local\Temp\glib-0.12.05760\glib-0.12.0\dist\setup\Main.o
)
Linking
C:\Users\Kyle\AppData\Local\Temp\glib-0.12.05760\glib-0.12.0\dist\setup\
setup.exe ...
Configuring glib-0.12.0...
setup.exe: Missing dependencies on foreign libraries:
* Missing C libraries: gobject-2.0, glib-2.0, intl
This problem can usually be solved by installing the system packages that
provide these libraries (you may need the "-dev" versions). If the libraries
are already installed but in a non-standard location then you can use the
flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
cabal: permission denied


-R. Kyle Murphy
--
Curiosity was framed, Ignorance killed the cat.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110318/198a5cc1/attachment-0001.htm>


More information about the Beginners mailing list