[Haskell-cafe] How can I get rid of this link error?

Amy de Buitléir amy at nualeargais.ie
Fri Nov 11 13:06:42 CET 2011


I wrote a library called AmysGeometry. The only modules in it (so far) are:

Amy/Geometry/ThreeD.hs
Amy/Geometry/UnitSphere.hs

The library compiles just fine, and I've been using it with other programs for a
while. Then yesterday, I started getting the following error.

Linking dist/build/add-centroids/add-centroids ...
/usr/local/lib/AmysGeometry-1.0/ghc-7.0.3/libHSAmysGeometry-1.0.a(UnitSphere.o):
In function `s3c6_info':
(.text+0x4557): undefined reference to 
`__stginit_AmysGeometryzm1zi0_AmyziGeometry_'
/usr/local/lib/AmysGeometry-1.0/ghc-7.0.3/libHSAmysGeometry-1.0.a(UnitSphere.o):
(.data+0x3f0):
undefined reference to `AmysGeometryzm1zi0_AmyziGeometry_DZCLocation_static_info'
collect2: ld returned 1 exit status
cabal: Error: some packages failed to install:

I think this started because I recompiled some stuff with profiling. So I wiped
out my current GHC and Haskell installation, re-installed it, and rebuilt
AmysGeometry. But I'm still getting this error when I try to link with it. I
would be grateful for any advice on how to diagnose this and fix it.

Oh, and "ghc-pkg check" doesn't report any errors.




More information about the Haskell-Cafe mailing list