【问题标题】:Install happstack-server 6.5.3 on osx - missing libcryptopp在 osx 上安装 happstack-server 6.5.3 - 缺少 libcryptopp
【发布时间】: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,您需要安装 macports iconv。或者反过来。 Mac 有点乱,因为似乎有很多不同的方法来安装包和它们的位置。但如果你明白这一点,我听说效果很好。

标签: macos haskell macports


【解决方案1】:

怎么样:

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

【讨论】:

  • 谢谢!这比尝试直接修复cryptopp make文件中的问题要好得多!
【解决方案2】:

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

文件:happstack-server.cabal:

Flag https
    Default: False

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


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

【讨论】:

  • 请注意,我实际上并没有尝试过,但我认为它有效。我改为切换应用服务器 :)
  • @Sean Clark Hess:你写的,我试过happstack-server 6.4.*,那行得通。 :)
猜你喜欢
  • 2013-01-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-03-30
  • 2019-10-26
  • 1970-01-01
  • 1970-01-01
  • 2013-10-18
相关资源
最近更新 更多