[Haskell-cafe] Problem linking against Data.Graph

Andy Gimblett A.M.Gimblett at swansea.ac.uk
Fri Jul 15 13:23:23 EDT 2005


Hi all,

I'm something of a Haskell newbie, and this is my first post to this
list.

I'm trying to do some very basic things with graphs, but can't get
started with Data.Graph.  In particular, linking fails - I'm wondering
if something's wrong with my install.  (For the record: ghc-6.4
compiled/installed fresh today on gentoo linux - it _looks_ OK to my
Haskell-untrained eyes).

Here follows a small example which I believe should compile just fine:

---- Code begins "Main.hs"

module Main where

import Data.Graph.Inductive
import System.IO

main :: IO ()
main = putStrLn "Hello, world!"

---- Code ends

As you can see, this basically does nothing!  Unfortunately, here's
what happens:

[csandy at cspcag spa_haskell] ghc -o Main Main.hs
Main.o(.text+0x145): In function `__stginit_Main_':
: undefined reference to `__stginit_DataziGraphziInductive_'
collect2: ld returned 1 exit status

I get similar errors whatever I try to do with Data.Graph.  Trying to
compile ghc-6.4/libraries/fgl/test/test.hs (from the source tree)
gives me multiple errors of the above type (though not identical).

If anyone can shed any light on this, or tell me what stupid thing I'm
doing wrong, I'd really appreciate it.

Many thanks,

-Andy

-- 
Andy Gimblett
Computer Science Department
University of Wales Swansea
http://www.cs.swan.ac.uk/~csandy/


More information about the Haskell-Cafe mailing list