我尝试使用Haskell堆栈(lts-6.12解析器)为Chart设置并运行small demo program。我使用stack new
,stack init
等创建了项目,然后修改了生成的Main.hs
,添加了演示代码。我还将Chart和Chart-cairo包添加到.cabal文件并运行stack build
。安装了很多很多软件包,包括Chart和Chart-cairo,从输出结果来看,当它最终完成时,它尝试编译Main.hs
,但失败并出现以下错误:
/home/asdf/my-project/app/Main.hs:4:8:
Could not find module ‘Graphics.Rendering.Chart.Easy’
It is a member of the hidden package ‘Chart-1.6@Chart_Cz416CvPROo70VikOoIoki’.
Perhaps you need to add ‘Chart’ to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.
/home/asdf/my-project/app/Main.hs:5:8:
Could not find module ‘Graphics.Rendering.Chart.Backend.Cairo’
It is a member of the hidden package ‘Chart-cairo-1.6@Chart_I1HGJHEm7pvIiSoYgOrXbq’.
Perhaps you need to add ‘Chart-cairo’ to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.
堆栈如何成功加载这些包,然后以某种方式无法在以后找到它们?如果它已经从那里获得它们以便首先加载它们,那么它如何让我将这些依赖项放在我的.cabal文件中呢(
)?以下是依赖关系列表:
$ stack list-dependencies
Chart 1.6
Chart-cairo 1.6
StateVar 1.1.0.4
adjunctions 4.3
array 0.5.1.0
base 4.8.2.0
base-orphans 0.5.4
bifunctors 5.2
binary 0.7.5.0
bytestring 0.10.6.0
cairo 0.13.1.1
colour 2.3.3
comonad 4.2.7.2
containers 0.5.6.2
contravariant 1.4
data-default-class 0.0.1
deepseq 1.4.1.1
distributive 0.5.0.2
exceptions 0.8.3
filepath 1.4.0.0
free 4.12.4
ghc-prim 0.4.0.0
hashable 1.2.4.0
hmatrix 0.17.0.2
integer-gmp 1.0.0.0
kan-extensions 4.2.3
lens 4.13
machine-learning 0.1.0.0
mtl 2.2.1
old-locale 1.0.0.7
operational 0.2.3.3
parallel 3.2.1.0
prelude-extras 0.4.0.3
primitive 0.6.1.0
profunctors 5.2
random 1.1
reflection 2.1.2
semigroupoids 5.0.1
semigroups 0.18.1
split 0.2.3.1
stm 2.4.4.1
storable-complex 0.2.2
tagged 0.8.4
template-haskell 2.10.0.0
text 1.2.2.1
time 1.5.0.1
transformers 0.4.2.0
transformers-compat 0.4.0.4
unordered-containers 0.2.7.1
utf8-string 1.0.1.1
vector 0.11.0.0
void 0.7.1
答案 0 :(得分:2)
如果您同时拥有executable
和library
节,请尝试列出
两者中的依赖关系。
如果您的可执行文件依赖于这些依赖项,但您只列出了它们 他们在你的图书馆节中,你会得到那个错误 - 来自的依赖 不同的诗节彼此独立。