import PrelAddr
Simon Marlow
simonmar@microsoft.com
Tue, 6 May 2003 13:38:12 +0100
=20
> I'm rewriting some old code,originally written for ghc-4.08.2 .
>=20
> 1)Now, when I compile with ghc-5.02 , fails:
>=20
> ghc -cpp -fglasgow-exts -O -fvia-C -syslib lang -syslib concurrent -c
> foo.hs
>=20
> foo.hs:47:
> failed to load interface for `PrelAddr':
> Could not find interface file for `PrelAddr'
> gmake: *** [foo.o] Error 1
>=20
>=20
> 2)if commented,
> --import PerlAddr
>=20
> ghc -cpp -fglasgow-exts -O -fvia-C -syslib lang -syslib concurrent -c
> foo.hs
>=20
> foo.hs:112: Type constructor or class not in scope: `Addr'
>=20
> foo.hs:514: Data constructor not in scope: `A#'
>=20
> gmake: *** [foo.o] Error 1
>=20
>=20
> 3)In doc available I'm recommended to import Foreign
>=20
> import Foreign
>=20
> ghc -cpp -fglasgow-exts -O -fvia-C -syslib lang -syslib concurrent -c
> foo.hs
>=20
> foo.hs:511: Data constructor not in scope: `A#'
>=20
> gmake: *** [foo.o] Error 1
The Addr type is now deprecated, and has been replaced by the Ptr type.
The 'A#' constructor belonged to the Addr type - the code shouldn't have
been using the internal representation. I suggest you change it to use
published interfaces instead because it will end up being more portable
to future versions of GHC.
Also, the -syslib option will be removed at some point; nowadays
-package is the right option to use.
Cheers,
Simon