如何在windows中安装haskell openid包

时间:2009-10-14 15:01:50

标签: windows haskell openid openssl

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

我做错了什么?

1 个答案:

答案 0 :(得分:1)

我怀疑某处可能存在版本不匹配。尝试在这里使用OpenSSL的预编译二进制文件:http://www.openssl.org/related/binaries.html

我能够在这里获得使用最新版HsOpenSSL的说明:http://hackage.haskell.org/trac/ghc/wiki/Builder(实际上我与维护者合作,使这些说明无需修补包。)