我使用阴谋安装了SourceGraph包:
cabal install SourceGraph
它安装得很完美,没有任何错误。
现在,我创建了一个名为Test.hs的文件来测试我是否能够导入这个包并使用它。以下是Test.hs的内容:
module Test where
import SourceGraph
main = putStrLn "Hello World!" 当我执行ghc Test时,会得到以下错误:
Could not find the module 'SourceGraph'
当我执行ghc-pkg list时,我在列表中找不到SourceGraph,尽管与它一起安装的所有依赖项都是可见的。
我签了C:\Users\MyName\AppData\Roaming\cabal\packages\hackage.haskell.org,可以在那里看到SourceGraph文件夹。
但是在.conf中没有SourceGraph文件。
而且,所有.log文件在C:\Users\MyName\AppData\Roaming\cabal\logs的末尾都有一行In-place registering packagename-version...,但SourceGraph-0.7.0.7,log没有。
请帮帮忙?
系统规格: GHCi版本7.10.2,Cabal版本: 1.22.4.0,操作系统: Windows 8 Pro,处理器: Intel Core i5 (64位)
发布于 2015-09-15 21:10:08
SourceGraph不是库,它是要在命令行上运行的程序。
看是黑客页面
这里写着(添加了bash提示符的$s ):
若要使用SourceGraph,请将其称为: $ SourceGraph path/to/Foo.cabal 或者,如果您的项目不使用Cabal,那么对>使用程序/库中的整个模块的支持是有限的: $ SourceGraph path/to/Foo.hs
https://stackoverflow.com/questions/32595609
复制相似问题