meaing of Cabal's extra-libraries field

Ryan Wisnesky ryan at peerium.com
Tue Sep 15 13:13:31 EDT 2009


Hello,

I have a probably very dumb question about how to use Cabal - I'm just  
starting out with it.  If this list isn't the right place to post the  
question, please let me know.

It seems like when I add an Extra-libraries field to a cabal source  
package description:

Name: LibraryFoo
...
Library
  Extra-libraries:  Bar

this has the effect that when loading package LibraryFoo in ghci, ghci  
will necessarily try to open a corresponding Bar.so/.dll/.dylib file:

 > ghci -package LibraryFoo
Loading package LibraryFoo-0.1 ... <command line>: can't load .so/.DLL  
for: Bar (dlopen(Bar.dylib, 10): image not found)

What I want to do is statically link LibraryFoo against Bar before  
Cabal installs the package, (so that, for instance, I can run ghci  
without a bunch of command line linking arguments and don't need to  
have Bar around anymore), and I have a Bar.o file for just such a  
purpose.  Is there a way to get Cabal to do this?

Thanks for your help,
Ryan Wisnesky


More information about the Libraries mailing list