【发布时间】:2014-11-19 01:57:50
【问题描述】:
我有一个使用 Cabal 构建和安装的 Haskell 包。在包目录中运行 cabal repl 工作正常,所有模块导入工作等。当我尝试在另一个目录中使用包时,导入不会抱怨,但是当我尝试使用文件中的函数时,我收到此错误在 GHCi 中
λ> import Data.Frame
λ> import Data.Frame.CSV
λ> :t fromCsvHeaders
/Users/Stian/.cabal/lib/x86_64-osx-ghc-7.8.3/frame-0.1.0.0/Data/Frame/CSV.dyn_hi
Declaration for fromCsvHeaders:
Failed to load interface for ‘Data.Frame.Internal’
Perhaps you haven't installed the "dyn" libraries for package ‘frame-0.1.0.0’?
Use -v to see a list of the files searched for.
Cannot continue after interface file error
运行 ghc 时也会发生同样的情况。
【问题讨论】:
-
frame 不是用--enable-shared 构建的,一些依赖于“frame”的包是用--enable-shared 构建的。这就是问题所在 - 解决方案是使用 --enable-shared 重新安装“框架”,或者在没有它的情况下依赖框架。