Error accessing data files from package code in Cabal: Unkown symbol

Duncan Coutts duncan.coutts at
Wed Jul 2 12:17:30 EDT 2008

On Wed, 2008-07-02 at 10:50 -0500, Alfonso Acosta wrote:
> On Wed, Jul 2, 2008 at 8:57 AM, Duncan Coutts
> <duncan.coutts at> wrote:
> > Do not hard code the path. It can change (via a command line flag).
> >
> > It's not necessary to hard code anything anyway, just using:
> >
> > other-modules: Paths_ForSyDe
> I tried to avoid doing it, but without adding dist/build/autogen to
> hs-source-dirs  (that is, leaving it as "hs-source-dirs:  src") I get
> the following error:
> Setup.hs: can't find source for Paths_ForSyDe in ["src"]

Ah, sorry, that bug was only fixed in Cabal-1.4 so yes it will not work
in Cabal-1.2.x.

The reason not that many people have run into this issue is that
typically it is executables not libraries that use data files and thus
use the Paths_pkgname module and for executables it's possible to get
away without listing all modules in the extra/other-modules fields.


More information about the Libraries mailing list