在osx上安装happstack-server 6.5.3 - 缺少libcryptopp

时间:2012-01-26 14:43:19

标签: macos haskell macports

我正在尝试在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

那么,我安装了libcryptopp和macports,它将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)

我做错了什么?或者这是一个快乐堆栈的错误?在通过macports安装lib后,我甚至没有.dylib,只有.a。 ghc --make Hello.hs is even crazier

2 个答案:

答案 0 :(得分:7)

怎么样:

g++ -fpic -nostartfiles -nostdlib -shared /usr/local/Cellar/cryptopp/5.6.1/lib/libcryptopp.a -o libcryptopp.dylib

答案 1 :(得分:2)

作为强力方法,您可以在happstack-server的.cabal文件中禁用https标记:

file:happstack-server.cabal

Flag https
    Default: False

手动配置/构建/安装happstack-servercabal install happstack


(我使用Archlinux, - extra-lib-dirs甚至不起作用!)