如何在Windows中安装haskell openid包

发布于 2024-08-07 05:54:15 字数 1205 浏览 2 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

日暮斜阳 2024-08-14 05:54:16

我怀疑某处可能存在版本不匹配。尝试在此处使用 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.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文