[Haskell-beginners] Compilation fails with Data.Numbers.Primes

Graham Enos graham.enos at gmail.com
Fri Jan 7 17:51:32 CET 2011


Hi all,

I'm having trouble compiling (with GHC) a program that uses the
Data.Numbers.Primes package (newest, 0.2.0.0) on Mac OS X, 10.6. Any
help would be greatly appreciated!

It gets to the linking stage, and then complains of undefined symbols:

ghc -O2 counting_primes_200.hs
Undefined symbols:

"_primeszm0zi2zi0zi0_DataziNumbersziPrimes_primeFactorszuprimes1_closure",
referenced from:
      _s1bm_info in counting_primes_200.o
      _s1bv_info in counting_primes_200.o
      _Main_main5_info in counting_primes_200.o
      _Main_main2_srt in counting_primes_200.o
      _Main_main5_srt in counting_primes_200.o
  "___stginit_primeszm0zi2zi0zi0_DataziNumbersziPrimes_", referenced from:
      ___stginit_Main_ in counting_primes_200.o
ld: symbol(s) not found
collect2: ld returned 1 exit status


It's probably not a problem with the program I'm trying to compile,
because runhaskell and ghci handle it fine (though I'd be happy to send
along the source to anyone interested). It's also not necessarily a
broken compiler, since GHC will compile simple throwaway stuff still and
I've installed the newest Haskell environment; this problem happened on
both my previous GHC installation and the newest. I was wondering if
anyone else was having linking problems with the primes package, and
what I could do to compile/link correctly. Thanks very much!

Best,
Graham



More information about the Beginners mailing list