如何在Windows中安装haskell openid包
haskell 'openid' 软件包依赖于需要 openssl 的 HsOpenSSL 和 nano-hmac 软件包。我已经在 C:\OpenSSL\ 目录中为 MinGW 编译了 openssl,并使用以下命令安装了 openid 包:
cabal install openid --extra-include-dirs=C:\OpenSSL\outinc --extra-lib-dirs=C:\OpenSSL\out
当我尝试使用此包编译 haskell 程序时,我收到很多链接错误。
test.hs:
import Network.OpenID
main = print "ok"
ghc --make test.hs
:
Linking test.exe ...
C:\OpenSSL\out/libcrypto.a(m_sha1.o):m_sha1.c:(.text+0x60): multiple definition of `EVP_sha1'
C:\OpenSSL\out/libeay32.a(deegs01228.o):(.text+0x0): first defined here
C:\OpenSSL\out/libcrypto.a(m_sha1.o):m_sha1.c:(.text+0x100): multiple definition of `EVP_sha256'
C:\OpenSSL\out/libeay32.a(deegs01230.o):(.text+0x0): first defined here
.....
C:\OpenSSL\out/libssl.a(ssl_lib.o):ssl_lib.c:(.text+0x2d4): undefined reference to `X509_VERIFY_PARAM_set_purpose'
C:\OpenSSL\out/libssl.a(ssl_lib.o):ssl_lib.c:(.text+0x2f1): undefined reference to `X509_VERIFY_PARAM_set_purpose'
C:\OpenSSL\out/libssl.a(ssl_lib.o):ssl_lib.c:(.text+0x314): undefined reference to `X509_VERIFY_PARAM_set_trust'
.....
collect2: ld returned 1 exit status
我做错了什么?
haskell 'openid' package depends on HsOpenSSL and nano-hmac packages which requires openssl. I've compiled openssl for MinGW in C:\OpenSSL\ directory and installed openid package with following command:
cabal install openid --extra-include-dirs=C:\OpenSSL\outinc --extra-lib-dirs=C:\OpenSSL\out
When I'm trying to compile haskell program using this package I'm receiving lots linking errors.
test.hs:
import Network.OpenID
main = print "ok"
ghc --make test.hs
:
Linking test.exe ...
C:\OpenSSL\out/libcrypto.a(m_sha1.o):m_sha1.c:(.text+0x60): multiple definition of `EVP_sha1'
C:\OpenSSL\out/libeay32.a(deegs01228.o):(.text+0x0): first defined here
C:\OpenSSL\out/libcrypto.a(m_sha1.o):m_sha1.c:(.text+0x100): multiple definition of `EVP_sha256'
C:\OpenSSL\out/libeay32.a(deegs01230.o):(.text+0x0): first defined here
.....
C:\OpenSSL\out/libssl.a(ssl_lib.o):ssl_lib.c:(.text+0x2d4): undefined reference to `X509_VERIFY_PARAM_set_purpose'
C:\OpenSSL\out/libssl.a(ssl_lib.o):ssl_lib.c:(.text+0x2f1): undefined reference to `X509_VERIFY_PARAM_set_purpose'
C:\OpenSSL\out/libssl.a(ssl_lib.o):ssl_lib.c:(.text+0x314): undefined reference to `X509_VERIFY_PARAM_set_trust'
.....
collect2: ld returned 1 exit status
What I'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑某处可能存在版本不匹配。尝试在此处使用 OpenSSL 的预编译二进制文件:http://www.openssl.org/lated/binaries。 "
我能够在此处获取使用最新版本的 HsOpenSSL 的说明:
I suspect there may be a version mismatch somewhere. Try using the precompiled binaries for OpenSSL here: http://www.openssl.org/related/binaries.html
I was able to get the instructions here to work with the latest version of HsOpenSSL: http://hackage.haskell.org/trac/ghc/wiki/Builder (in fact I worked with the maintainer to make these instructions work without needing to patch the package.)