[Haskell-beginners] Re: Installing Gtk2hs

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sun Nov 30 17:43:45 EST 2008


On Sun, 2008-11-30 at 09:24 +0000, Colin Paul Adams wrote:
> >>>>> "Colin" == Colin Paul Adams <colin at colina.demon.co.uk> writes:
> 
>     Colin> Now it installs OK with 6.8.3, and all the demos run.
> 
> Well, not quite all:
> 
> mozembed fails to compile with:
> 
> TestEmbedMoz.hs:5:7:
>     Could not find module `Graphics.UI.Gtk.MozEmbed':
>       Use -v to see a list of the files searched for.
> make: *** [testembedmoz] Error 1

This almost certainly is because you didn't build the mozembed component
of gtk2hs. The ./configure script lists all the bits that it's going to
build. By default if the corresponding C devel package is not available
then the binding will not be built. If you really want to build it then
use ./configure --enable-firefox or --enable-xulrunner and it will stop
and report exactly what bits it needed but could not find.

> And the svgviewer programs fail at runtime with:
> 
> svgviewer: user error (Pattern match failure in do expression at SvgViewer.hs:11:2-9)

That's kind of by design, it's a simple demo program that does no error
checking on the command line arguments. See that line in the source
code:

  (file:_) <- getArgs

So if you call it with a single .svg file parameter it should work.

> and:
> 
> svg2png: user error (Pattern match failure in do expression at Svg2Png.hs:9:2-18)

Same issue.

> and for treelist:
> 
> make: *** No rule to make target `TreeSort.hs', needed by `treesort'.  Stop.

Good catch, that file is missing from the tarball.

> and for opengl:
> 
> ghc --make RotatingCube.hs -o cube 
> 
> RotatingCube.hs:7:17:
>     Could not find module `Graphics.UI.Gtk.OpenGL':
>       Use -v to see a list of the files searched for.
> make: *** [cube] Error 1

Same as the fist problem. You built gtk2hs without the opengl component.
Use ./configure --enable-opengl and it'll tell you what you're missing.

> and for sourceview:
> 
> ghc --make SourceViewTest.hs -o sourceview 
> 
> SourceViewTest.hs:5:7:
>     Could not find module `Graphics.UI.Gtk.SourceView':
>       Use -v to see a list of the files searched for.
> make: *** [sourceview] Error 1

Same problem again, but for the sourceview component.
./configure --enable-sourceview

Basically you need to install a bunch of -devel fedora packages so that
the Haskell bindings can be built. The thing to check is the summary
produced at that end of running ./configure

Duncan



More information about the Beginners mailing list