【发布时间】:2012-01-26 14:43:18
【问题描述】:
我正在尝试在 osx 上安装最新的 happstack-server。他们只是添加了对 libcryptopp 的依赖,我无法让它工作。
~$ cabal install happstack-server
Resolving dependencies...
Configuring happstack-server-6.5.3...
cabal: Missing dependency on a foreign library:
* Missing C library: cryptopp
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
cabal: Error: some packages failed to install:
happstack-server-6.5.3 failed during the configure step. The exception was:
ExitFailure 1
所以,然后我用 macports 安装 libcryptopp,它将 libcryptopp.a 放在 /opt/local/lib 中
sudo port install libcryptopp
然后我用 --extra-lib-dirs 再次安装 happstack-server
cabal install happstack-server --extra-lib-dirs=/opt/local/lib
它安装得很好,在我真正运行一个 happstack 服务器之前,一切似乎都正常工作。
~$ runhaskell Hello.hs
Hello.hs: <command line>: can't load .so/.DLL for: libcryptopp.dylib (dlopen(libcryptopp.dylib, 9): image not found)
我做错了什么?或者这是 happstack 的错误?通过 macports 安装 lib 后,我什至没有 .dylib,只有 .a。 ghc --make Hello.hsis even crazier
【问题讨论】:
-
Hello.hs错误可能是由于错误的iconv库引起的。我一直忘记是哪个,但我认为系统一不适用于 Haskell,您需要安装 macportsiconv。或者反过来。 Mac 有点乱,因为似乎有很多不同的方法来安装包和它们的位置。但如果你明白这一点,我听说效果很好。