我正在尝试在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.hs is even crazier

最佳答案

作为强力手段,您可以在happstack-server的.cabal文件中禁用https标志:

文件:happstack-server.cabal :

Flag https
    Default: False

手动配置/构建/安装happstack-server,它们是cabal install happstack

(我使用的是Archlinux,-extra-lib-dirs甚至无法正常工作!)

关于macos - 在OSX上安装Happstack-server 6.5.3-缺少libcryptopp,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/9019815/

10-11 20:25