How to install haskell openid package on windows

The haskell 'openid' package depends on the HsOpenSSL and nano-hmac packages that require openssl. I compiled openssl for MinGW in the C: \ OpenSSL \ directory and installed the openid package with the following command:

cabal install openid --extra-include-dirs=C:\OpenSSL\outinc --extra-lib-dirs=C:\OpenSSL\out

When I try to compile a haskell program using this package, I get a lot of error references.

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 am I doing wrong?

+3
source share
1 answer

I suspect there might be a version mismatch. Try using the precompiled binaries for OpenSSL here: http://www.openssl.org/related/binaries.html

HsOpenSSL: http://hackage.haskell.org/trac/ghc/wiki/Builder ( .)

+1

Source: https://habr.com/ru/post/1720085/


All Articles