[Haskell-cafe] Re: Compiling packages for GHCi

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Wed Jun 6 09:29:00 EDT 2007


On Jun 6, 2007, at 7:55 , Simon Marlow wrote:

> Grzegorz wrote:
>> I don't have a libmaxent.so, the maxent library in at /usr/local/ 
>> lib/libmaxent.a
>> Can I somhow use my package with GHCi?
>
> No, you need the .so.  GHCi can't load static .a libraries.  If you  
> really have no way to get a .so, then it is possible to create a .o  
> from the .a that GHCi can load using 'ld --whole-archive', but  
> you're into hacker territory there.

Alternately, just extract the contents of the .a into a subdirectory  
and explicitly load them:

mkdir libmaxent
cd libmaxent
ar x /usr/local/lib/libmaxent.a
cd ..
ghci (...) libmaxent/*.o

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Haskell-Cafe mailing list