[Haskell-cafe] ghc does not want to link statically

Joel Reymont joelr1 at gmail.com
Sat Jul 1 10:08:55 EDT 2006


I'm trying to compile the Haskell Objective-C Binding (HOC) and it  
needs /usr/lib/libSystemStubs.a to find the missing _fprintf$LDBLStub  

I tried the following in the make file

FOUNDATION_LIBS=-static -lSystemStubs -l dynamic -framework Foundation

but ghc still tries to link libSystemStubs.a dynamically. How do I  
fix this?

ghc --make HOC.hs       \
         -odir build/objects -hidir build/imports        \
         -fglasgow-exts -package-name HOC \
         ../HOC_cbits/HOC_cbits.o        \
         -I../HOC_cbits  \
         -I../libffi-src/build/include   \
         -static -lSystemStubs -dynamic -framework Foundation      \
Loading package base-1.0 ... linking ... done.
Loading object (static) ../HOC_cbits/HOC_cbits.o ... done
Loading object (dynamic) SystemStubs ... failed.
Dynamic linker error message was:
    dlopen(libSystemStubs.dylib, 10): image not found
Whilst trying to load:  (dynamic) SystemStubs
Directories to search are:
ghc-6.4.2: user specified .o/.so/.DLL could not be loaded.
make[1]: *** [ghcmake.build-stamp] Error 1

	Thanks, Joel


More information about the Haskell-Cafe mailing list