如何构建使用文本库进行分析的程序?
我正在构建一个链接到 text 库的程序。当我在没有分析的情况下构建它时,一切正常:
ghc -O2 buildtrie.hs -package text -package hamt -o buildtrie -auto-all -package text -package hamt -fforce-recomp
<No output>
当我使用分析构建它时,我收到以下错误:
ghc -O2 buildtrie.hs -package text -package hamt -o buildtrie -auto-all -package text -package hamt -fforce-recomp -prof
ld: library not found for -lHStext-0.10.0.0_p
collect2: ld returned 1 exit status
我通过 cabal 安装了 text-0.11.0.1 的分析版本,但它没有似乎正在找到它。我猜测 text-0.10.0.0 是随 Haskell Platform 安装的。 ghc-pkg 列表文本为我提供了以下内容:
/usr/local/Cellar/ghc/6.12.3/lib/ghc/package.conf.d
/Users/jason/.ghc/i386-darwin-6.12.3/package.conf.d
text-0.10.0.0
text-0.11.0.1
如何使用 text-0.11.0.1 的分析版本来编译此程序?
I'm building a program that links to the text library. When I build it without profiling, everything works fine:
ghc -O2 buildtrie.hs -package text -package hamt -o buildtrie -auto-all -package text -package hamt -fforce-recomp
<No output>
When I build it with profiling, I get the following error:
ghc -O2 buildtrie.hs -package text -package hamt -o buildtrie -auto-all -package text -package hamt -fforce-recomp -prof
ld: library not found for -lHStext-0.10.0.0_p
collect2: ld returned 1 exit status
I installed a profiling version of text-0.11.0.1 through cabal, but it doesn't seem to be finding it. I'm guessing that text-0.10.0.0 was installed with Haskell Platform. A ghc-pkg list text
gives me the following:
/usr/local/Cellar/ghc/6.12.3/lib/ghc/package.conf.d
/Users/jason/.ghc/i386-darwin-6.12.3/package.conf.d
text-0.10.0.0
text-0.11.0.1
How can I compile this program using the profiling version of text-0.11.0.1?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能发生的情况是,您引入的其他依赖项之一依赖于旧版本的文本,这就是它被首选的原因。不过,这很难确定,因为你似乎没有使用 Cabal。
一个简单的权宜之计是通过分析在本地重新安装 text-0.10.0.0。
(假设您已正确设置 .cabal 配置;否则,请添加适当的标志。)
What's likely happening is that one of the other dependencies you are pulling in depends on an old version of text, which is why it is being preferred. It's hard to say for certain, though, because you don't appear to be using Cabal.
An easy stop-gap is to reinstall text-0.10.0.0 locally with profiling.
(assuming you've frobbed your .cabal configuration correctly; otherwise, add appropriate flags.)