0

我对 Haskell 完全陌生。我正在尝试构建https://github.com/wireapp/mls-server项目。当我运行时make build,我得到未定义的参考错误:

Linking .stack-work/dist/x86_64-linux/Cabal-2.2.0.1/build/mls-server-test/mls-server-test ...
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o)(.text+0x69d): error: undefined reference to 'EVP_CIPHER_CTX_init'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o)(.text+0x7e5): error: undefined reference to 'EVP_CIPHER_CTX_init'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o)(.text+0x89d): error: undefined reference to 'EVP_CIPHER_CTX_init'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o)(.text+0x9e5): error: undefined reference to 'EVP_CIPHER_CTX_init'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o):HsOpenSSLzm0zi11zi4zi14zm1RUGvOiXKv4J8uIsPTtnnt_OpenSSLziEVPziInternal_digestLazzily3_info: error: undefined reference to 'EVP_MD_CTX_create'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o):HsOpenSSLzm0zi11zi4zi14zm1RUGvOiXKv4J8uIsPTtnnt_OpenSSLziEVPziInternal_digestLazzily3_info: error: undefined reference to 'EVP_MD_CTX_init'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o):HsOpenSSLzm0zi11zi4zi14zm1RUGvOiXKv4J8uIsPTtnnt_OpenSSLziEVPziInternal_digestLazzily3_info: error: undefined reference to 'EVP_MD_CTX_destroy'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o):HsOpenSSLzm0zi11zi4zi14zm1RUGvOiXKv4J8uIsPTtnnt_OpenSSLziEVPziInternal_digestLazzily3_info: error: undefined reference to 'EVP_MD_CTX_init'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o):HsOpenSSLzm0zi11zi4zi14zm1RUGvOiXKv4J8uIsPTtnnt_OpenSSLziEVPziInternal_digestLazzily3_info: error: undefined reference to 'EVP_MD_CTX_destroy'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Store.o):HsOpenSSLzm0zi11zi4zi14zm1RUGvOiXKv4J8uIsPTtnnt_OpenSSLziX509ziStore_getStoreCtxChain1_info: error: undefined reference to 'X509_STORE_CTX_get_chain'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o)(.text+0x33): error: undefined reference to 'sk_new_null'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o)(.text+0xcc): error: undefined reference to 'sk_push'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o)(.text+0x1a2): error: undefined reference to 'sk_free'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o)(.text+0x242): error: undefined reference to 'sk_free'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o)(.text+0x3a2): error: undefined reference to 'sk_free'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o)(.text+0x41a): error: undefined reference to 'sk_free'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o)(.text+0xa6b): error: undefined reference to 'sk_value'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o)(.text+0xb73): error: undefined reference to 'sk_value'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o):HsOpenSSLzm0zi11zi4zi14zm1RUGvOiXKv4J8uIsPTtnnt_OpenSSLziStack_zdwmapStack_info: error: undefined reference to 'sk_num'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(X509.o)(.text+0x1dcf): error: undefined reference to 'X509_set_notBefore'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(X509.o)(.text+0x20cf): error: undefined reference to 'X509_set_notAfter'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Revocation.o)(.text+0x225f): error: undefined reference to 'X509_CRL_set_lastUpdate'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Revocation.o)(.text+0x255f): error: undefined reference to 'X509_CRL_set_nextUpdate'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_init: error: undefined reference to 'SSL_load_error_strings'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_init: error: undefined reference to 'OPENSSL_add_all_algorithms_noconf'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_HMAC_CTX_new: error: undefined reference to 'HMAC_CTX_init'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_HMAC_CTX_free: error: undefined reference to 'HMAC_CTX_cleanup'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_setupMutex: error: undefined reference to 'CRYPTO_num_locks'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_setupMutex: error: undefined reference to 'CRYPTO_num_locks'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_setupMutex: error: undefined reference to 'CRYPTO_set_locking_callback'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_setupMutex: error: undefined reference to 'CRYPTO_set_id_callback'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_setupMutex: error: undefined reference to 'CRYPTO_set_dynlock_create_callback'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_setupMutex: error: undefined reference to 'CRYPTO_set_dynlock_lock_callback'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_init: error: undefined reference to 'SSL_library_init'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_X509_ref: error: undefined reference to 'CRYPTO_add_lock'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_X509_CRL_ref: error: undefined reference to 'CRYPTO_add_lock'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_setupMutex: error: undefined reference to 'CRYPTO_set_dynlock_destroy_callback'
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
Progress 1/2

--  While building package mls-server-0.1.0 using:
      /home/euphoria/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.2.0.1 build lib:mls-server exe:mls-server exe:mls-server-schema test:mls-server-test --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 1

我已经尝试将 openssl 降级到 1.0.1g。我也试过更新它。尽管如此,我还是不断收到这些错误。不知道出了什么问题。

4

1 回答 1

0

这应该可以帮助您解决问题。如果您想使用现有的 openssl 备份,请确保您在使用此命令之前进行过备份sudo mv /usr/bin/openssl /usr/bin/openssl.backup

安装openssl-1.1.1g为我解决了这些链接器问题。也许绑定期待这个版本。

  $ sudo rm -rf /usr/bin/openssl /usr/share/man/man1/openssl.1ssl.gz
  $ wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
  $ tar -zxf openssl-1.1.1g.tar.gz && cd openssl-1.1.1g
  $ ./config
  $ sudo apt install make gcc
  $ make
  $ make test
  $ sudo make install
  $ sudo ln -s /usr/local/bin/openssl /usr/bin/openssl
  $ sudo ldconfig
  $ cd ..
  $ rm -rf openssl-1.1.1g*

如果上述所有步骤都对您成功,您应该可以使用检查版本详细信息$ openssl version -a

OpenSSL 1.1.1g 2020 年 4 月 21 日构建于:2020 年 8 月 5 日星期三 07:16:04 UTC 平台:linux-x86_64 选项:bn(64,64)rc4(16x,int)des(int)idea(int)blowfish(ptr ) compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DNDEBUG OPENSSLDIR: "/usr/local/ssl" ENGINESDIR: "/usr/local/lib/engines-1.1" 种子来源:操作系统特定

于 2020-08-06T08:36:50.240 回答