Linking executables and the library of a Cabal package description

Simon Marlow simonmarhaskell at
Tue Oct 16 09:19:33 EDT 2007

John D. Ramsdell wrote:
> I'm sure this will be an easy question for those on this list.  What
> do you need to add to a Cabal package description so as to allow an
> executable in the description to be built from the library it also
> describes?  I searched the Cabal documentation many times, but came up
> empty handed.
> John
> $ make
> runhaskell Setup.hs build
> Preprocessing library a-1.0...
> Preprocessing executables for a-1.0...
> Building a-1.0...
> [1 of 1] Compiling A                ( A.hs, dist/build/A.o )
> /usr/bin/ar: creating dist/build/libHSa-1.0.a
> exec/Main.hs:3:7:
>     Could not find module `A':
>       Use -v to see a list of the files searched for.

I'm not sure exactly what problem you're running into here, but my advice 
would be to split the library off into a separate package.  Libraries and 
executables in the same package are not well supported by Cabal.

Really we should fix or remove that feature, my vote would be to remove it.


More information about the Libraries mailing list