Hi,
there's a couple of things going on here:
* Makefile dependencies are not being computed
for the pcre/ sample.
To fix, reverse the ordering in HS_SRCS, i.e.,
have it say
HS_SRCS = Pcre.hs RegLib.lhs Main.lhs
* The parse error you're getting while processing
types.h is a bug in 0.16's parser - it doesn't
support prefix GNU attribute decls (which glibc
must have started using recently, since it used to
work just fine.) A fix is available via the CVS
repository.
If you need the fix & don't have access to CVS,
let me know.
* toInt/fromInt issues - if you're using a version
of GHC that supports this via GlaExts (as was the
case for 4.04pl0), you have to manually adjust the
generated Haskell source to use it instead of Int.
For people that use older versions of GHC (and Hugs),
there's the hdirect option -fint-prelude-coercions
to have it pick up toInt/fromInt via the Prelude.
hth
--sigbjorn
[EMAIL PROTECTED] writes:
>
> Sigbjorn,
>
> Whilst I was trying to get a linux expert help me with
> building the Hugs compatible version of HaskellDirect
> (scheduled for Friday), I tried the pcre example. If you
> recall, you pointed me at it as an example of how I might
> interface to the LDAP C library. Unfortunately, I ran into
> problems. I did get the math example to work (after
> patching the code produced by HaskellDirect to pick up toInt
> from GlaExts). Presumably, getting the dependencies
> right in the Makefile would fix 1 and 2.
>
> 1. [dom@lhrtbax pcre]$ make
> /usr/local/bin/ghc -fglasgow-exts -fno-prune-tydecls
> -I/home/dom/pcre-2.08/ -L/h
> ome/dom/pcre-2.08/ -lpcre -i../../lib -c Main.lhs -o
> Main.o -osuf o
>
> Main.lhs:10: Could not find valid interface file `RegLib'
>
> Compilation had errors
>
> make: *** [Main.o] Error 1
>
>
> 2. [dom@lhrtbax pcre]$ make RegLib
> /usr/local/bin/ghc -fglasgow-exts -fno-prune-tydecls
> -I/home/dom/pcre-2.08/ -L/h
> ome/dom/pcre-2.08/ -lpcre -i../../lib -c RegLib.lhs -o
> RegLib.o -osuf o
>
> RegLib.lhs:10: Could not find valid interface file `Pcre'
>
> Compilation had errors
>
> make: *** [RegLib.o] Error 1
>
>
> 3. [dom@lhrtbax pcre]$ make Pcre
> ../../src/ihc -fhs-to-c -fno-qualified-names
> -fexclude-system-includes -cpp -I/h
> ome/dom/pcre-2.08/ --asf=Pcre.asf -fvoid-typedef-is-abstract
> -finline-synonyms -
> fout-pointers-are-not-refs -c Pcre.idl -o Pcre.hs
> failed
> Reason: /usr/include/bits/types.h:38: Parse error on input:
> unsigned long long
> int __u_quad_t;
>
> make: *** [Pcre.hs] Error 1
>
>
> Dominic.
>