[Haskell-cafe] trivial ghc problem, help needed

Donald Bruce Stewart dons at cse.unsw.edu.au
Wed Nov 22 18:03:19 EST 2006


clawsie:
> i have a program tb.hs:
> 
> ---
> module Main where
> import Network.URI (URI(..), URIAuth(..), parseURI)
> 
> myFunc :: String -> Maybe URI
> myFunc u = parseURI u
> 
> main = do { return () }
> ---
> 
> when i attempt to build it with ghc, i get the following output:
> 
> tb.o: In function `Main_myFunc_info':
> (.text+0x11): undefined reference to
> `networkzm2zi0_NetworkziURI_parseURI_closure'
> tb.o: In function `Main_myFunc_srt':
> (.rodata+0x0): undefined reference to
> `networkzm2zi0_NetworkziURI_parseURI_closure'
> collect2: ld returned 1 exit status
> 
> any clue why? i would send this to the ghc list but i presume my issue
> is due to a trivial misunderstanding of the language

Assuming you have the Network package installed, you need to tell the
compile to link in the extra network library. The above is a linker
error.

Adding
    --make
or
    -package network

to the command line should do the trick.

-- Don


More information about the Haskell-Cafe mailing list