Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Simon Marlow <simonmarhaskell <at> gmail.com>
Subject: Re: Compiling packages for GHCi
Newsgroups: gmane.comp.lang.haskell.cafe
Date: Wednesday 6th June 2007 11:55:41 UTC (over 10 years ago)
Grzegorz wrote:
> Hi,
> I'm having problems using a package which links in foreign libraries from
GHCi.
> 
> I use a .cabal file to build the package and have the following option
there:
> 
> extra-libraries:    stdc++ maxent z m gfortran m gcc_s
> 
> 
> After installation, it works fine when I compile code using that package.
> However, when I try it from GHCi I get:
> 
> Loading package binary-0.3 ... linking ... done.
> Loading package filepath-1.0 ... linking ... done.
> Loading package haskell98 ... linking ... done.
> Loading package mtl-1.0.1 ... linking ... done.
> Loading package parsec-2.0 ... linking ... done.
> Loading package gramlab-lib-0.1 ... linking ... done.
> Loading package maxent-0.0 ... can't load .so/.DLL for: maxent
(libmaxent.so:
> cannot open shared object file: No such file or directory)
> 
> 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.

Cheers,
	Simon
 
CD: 3ms