Cabal库无法导入公开的模块

rausted

我的foo.cabal文件如下所示:

library
  exposed-modules:
      Foo.Bar,
      Foo.Something
  hs-source-dirs:      lib
  default-language:    Haskell2010

executable foobar
  main-is:             Main.hs
  other-modules:
      Utils,  -- Local module in ./src
      Foo.Bar

  hs-source-dirs:      src
  default-language:    Haskell2010

根据此处的示例代码:https : //www.haskell.org/cabal/users-guide/developing-packages.html#example-a-package- contains-a-library-and-executable-programs

我收到以下错误:

$ cabal build
Resolving dependencies...
Configuring foobar-0.1.0.0...
Preprocessing executable 'foobar' for foobar-0.1.0.0..
cabal: can't find source for Foo/Bar in src, dist/build/foobar/autogen,
dist/build/global-autogen
lv

将行添加build-depends: foo到可执行文件节中,以指示可执行文件取决于您所定义的库。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章