libssh2静态库编译

来源:互联网 发布:课程表软件电脑版 编辑:程序博客网 时间:2024/05/19 22:05
/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



0 0
原创粉丝点击