[Haskell-cafe] Compiling Simple Regex Program

Stefan O'Rear stefanor at cox.net
Sat Sep 29 21:32:38 EDT 2007


On Sat, Sep 29, 2007 at 09:25:40PM -0400, Andrew Trusty wrote:
> Hello,
>
> I'm using GHC 6.6.1 under Windows XP and I can't get the following simple 
> program to compile.
>
> import Text.Regex
> main = putStrLn (subRegex (mkRegex "c") "abc" "a")
>
>
> It runs in GHCi just fine but GHC gives the following output when trying to 
> compile:
>
> project1.o(.text+0x169):fake: undefined reference to 
> `regexzmcompatzm0zi71_Textz
> iRegex_mkRegex_closure'
> project1.o(.text+0x1f7):fake: undefined reference to 
> `regexzmcompatzm0zi71_Textz
> iRegex_subRegex_closure'
> project1.o(.rodata+0x4):fake: undefined reference to 
> `regexzmcompatzm0zi71_Textz
> iRegex_mkRegex_closure'
> project1.o(.rodata+0x8):fake: undefined reference to 
> `regexzmcompatzm0zi71_Textz
> iRegex_subRegex_closure'
> collect2: ld returned 1 exit status

Use --make, or -package regex-compat.  Like most compilers, GHC defaults
to not linking unspecified libraries.  (I've already sugested to Ian
that this be changed for 6.10)

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20070929/c4f80057/attachment.bin


More information about the Haskell-Cafe mailing list