libssh2静态库编译

/home/app/libssh2/lib/libssh2.a(transport.o): In function `_libssh2_transport_send':
/home/app/libssh2-1.4.3/src/transport.c:830: undefined reference to `RAND_bytes'
/home/app/libssh2-1.4.3/src/transport.c:830: undefined reference to `RAND_bytes'
/home/app/libssh2/lib/libssh2.a(openssl.o): In function `read_private_key_from_file':
/home/app/libssh2-1.4.3/src/openssl.c:400: undefined reference to `BIO_new_file'
/home/app/libssh2-1.4.3/src/openssl.c:408: undefined reference to `BIO_free'
/home/app/libssh2/lib/libssh2.a(openssl.o): In function `write_bn':
/home/app/libssh2-1.4.3/src/openssl.c:543: undefined reference to `BN_bn2bin'
/home/app/libssh2/lib/libssh2.a(openssl.o): In function `_libssh2_pub_priv_keyfile':
/home/app/libssh2-1.4.3/src/openssl.c:752: undefined reference to `BIO_new_file'
/home/app/libssh2-1.4.3/src/openssl.c:759: undefined reference to `EVP_get_cipherbyname'
/home/app/libssh2-1.4.3/src/openssl.c:767: undefined reference to `BIO_ctrl'
/home/app/libssh2-1.4.3/src/openssl.c:768: undefined reference to `PEM_read_bio_PrivateKey'
/home/app/libssh2-1.4.3/src/openssl.c:769: undefined reference to `BIO_free'
/home/app/libssh2-1.4.3/src/openssl.c:800: undefined reference to `EVP_PKEY_free'
/home/app/libssh2/lib/libssh2.a(openssl.o): In function `gen_publickey_from_dsa_evp':
/home/app/libssh2-1.4.3/src/openssl.c:697: undefined reference to `EVP_PKEY_get1_DSA'
/home/app/libssh2/lib/libssh2.a(openssl.o): In function `gen_publickey_from_dsa':
/home/app/libssh2-1.4.3/src/openssl.c:596: undefined reference to `BN_num_bits'
/home/app/libssh2-1.4.3/src/openssl.c:597: undefined reference to `BN_num_bits'
/home/app/libssh2-1.4.3/src/openssl.c:598: undefined reference to `BN_num_bits'
/home/app/libssh2-1.4.3/src/openssl.c:599: undefined reference to `BN_num_bits'
/home/app/libssh2/lib/libssh2.a(openssl.o): In function `gen_publickey_from_dsa_evp':
/home/app/libssh2-1.4.3/src/openssl.c:712: undefined reference to `DSA_free'
/home/app/libssh2/lib/libssh2.a(openssl.o): In function `gen_publickey_from_rsa_evp':
/home/app/libssh2-1.4.3/src/openssl.c:669: undefined reference to `RSA_free'
/home/app/libssh2-1.4.3/src/openssl.c:643: undefined reference to `EVP_PKEY_get1_RSA'
/home/app/libssh2/lib/libssh2.a(openssl.o): In function `gen_publickey_from_rsa':
/home/app/libssh2-1.4.3/src/openssl.c:561: undefined reference to `BN_num_bits'
/home/app/libssh2-1.4.3/src/openssl.c:562: undefined reference to `BN_num_bits'
/home/app/libssh2/lib/libssh2.a(openssl.o): In function `gen_publickey_from_rsa_evp':
/home/app/libssh2-1.4.3/src/openssl.c:658: undefined reference to `RSA_free'
/home/app/libssh2/lib/libssh2.a(openssl.o): In function `gen_publickey_from_dsa_evp':
/home/app/libssh2-1.4.3/src/openssl.c:723: undefined reference to `DSA_free'
/home/app/libssh2/lib/libssh2.a(openssl.o): In function `_libssh2_pub_priv_keyfile':
/home/app/libssh2-1.4.3/src/openssl.c:765: undefined reference to `OpenSSL_add_all_ciphers'
/home/app/libssh2/lib/libssh2.a(openssl.o): In function `libssh2_md5':
/home/app/libssh2-1.4.3/src/openssl.c:529: undefined reference to `EVP_get_digestbyname'
/home/app/libssh2-1.4.3/src/openssl.c:529: undefined reference to `EVP_DigestInit'
/home/app/libssh2-1.4.3/src/openssl.c:530: undefined reference to `EVP_DigestUpdate'
/home/app/libssh2-1.4.3/src/openssl.c:531: undefined reference to `EVP_DigestFinal'
/home/app/libssh2/lib/libssh2.a(openssl.o): In function `libssh2_sha1':
/home/app/libssh2-1.4.3/src/openssl.c:518: undefined reference to `EVP_get_digestbyname'
/home/app/libssh2-1.4.3/src/openssl.c:518: undefined reference to `EVP_DigestInit'

libssh2静态库编译报上面错误

解决方法:

编译的时候添加头文件

#include <zlib.h>

-lcrypto   -lz



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值