thrift 编译报错 undefined reference

问题描述

编译 thrift 时报错:

...
src/thrift/generate/thrift-t_lua_generator.o  src/thrift/libparse.a ./.libs/libthriftc.so -lrt -lpthread
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `GENERAL_NAME_free@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_get_verify_result@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_CTX_set_default_passwd_cb_userdata@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `sk_num@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_CTX_ctrl@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `CRYPTO_set_dynlock_lock_callback@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_accept@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_new@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_CTX_set_cipher_list@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `TLSv1_method@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `ERR_get_error@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `BIO_new@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `TLSv1_1_method@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `CRYPTO_cleanup_all_ex_data@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `ASN1_STRING_length@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_free@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_shutdown@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `ERR_remove_state@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `X509_NAME_get_entry@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `CRYPTO_set_dynlock_create_callback@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_get_verify_mode@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `X509_get_subject_name@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_set_fd@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSLv3_method@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `sk_value@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `RAND_poll@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_get_shutdown@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `ASN1_STRING_to_UTF8@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_CTX_set_verify@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_write@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `X509_free@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSLv23_method@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `ERR_peek_error@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `CRYPTO_num_locks@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_connect@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_peek@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `TLSv1_2_method@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_get_peer_certificate@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_library_init@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_get_error@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `CRYPTO_set_dynlock_destroy_callback@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_CTX_load_verify_locations@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_get_rbio@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_CTX_new@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_CTX_use_PrivateKey_file@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_CTX_set_default_passwd_cb@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `ERR_free_strings@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `ASN1_STRING_data@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `BIO_ctrl@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_load_error_strings@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_ctrl@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `ERR_reason_error_string@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `CRYPTO_free@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `CRYPTO_set_locking_callback@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_CTX_free@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_read@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `X509_verify_cert_error_string@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `EVP_cleanup@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `ERR_clear_error@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_get_wbio@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `X509_NAME_get_index_by_NID@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `X509_NAME_ENTRY_get_data@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_CTX_use_certificate_chain_file@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `SSL_set_bio@libssl.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `BIO_s_mem@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `X509_get_ext_d2i@libcrypto.so.10'
/usr/local/lib/libthrift-0.10.0.so: undefined reference to `sk_pop_free@libcrypto.so.10'
collect2: error: ld returned 1 exit status
make[3]: *** [thrift] 错误 1
make[3]: 离开目录“/opt/thrift-0.10.0/compiler/cpp”
make[2]: *** [all-recursive] 错误 1
make[2]: 离开目录“/opt/thrift-0.10.0/compiler/cpp”
make[1]: *** [all-recursive] 错误 1
make[1]: 离开目录“/opt/thrift-0.10.0”
make: *** [all] 错误 2
解决方法

创建软连接,依赖 vix-lib 里面的加密库文件:

1)创建 libcrypto 链接,如果没有libcrypto.so.1.0.2 文件,从/opt/vmware-vix-disklib-distrib/lib64/中拷贝过来 (参考前一篇 centos 下安装 thrift

#  cd /lib64/
#  cp /opt/vmware-vix-disklib-distrib/lib64/libcrypto.so.1.0.2 /lib64/
#  ls -l libcry*
#  rm -f libcrypto.so.10
如果libcrypto.so.1.0.2没有执行权限,添加执行权限
#  chmod a+x libcrypto.so.1.0.2
#  ln -s libcrypto.so.1.0.2 libcrypto.so.10

2)创建 libssl 链接,如果没有libssl.so.1.0.2 文件,从/opt/vmware-vix-disklib-distrib/lib64/中拷贝过来

#  ls -l libssl*
#  rm -f libssl.so.10
#  cp /opt/vmware-vix-disklib-distrib/lib64/libssl.so.1.0.2 /lib64/
如果libssl.so.1.0.2没有执行权限,添加执行权限
#  chmod a+x libssl.so.1.0.2
#  ln -s libssl.so.1.0.2 libssl.so.10




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值