Subject: AW: static linking problem

AW: static linking problem

From: may nothing <may_241913_at_yahoo.com>
Date: Tue, 19 Oct 2010 00:08:51 +0100 (BST)

>The order of arguments makes a difference. Try this order:

>gcc -Wall -I/usr/include -I/usr/local/include -static sftptest.c -o sftptest
>/usr/local/lib/libssh2.a
>

>and since you have already have -static there, this ought to work, too:

>gcc -Wall -I/usr/include -I/usr/local/include -static sftptest.c -o sftptest
>-lssh2

>>>> Dan

Hi,

sorry but that's even worse. It produces:

root_at_server: /data/work > gcc -Wall -I/usr/include -I/usr/local/include -static
sftptest.c -o sftptest -lssh2
sftptest.c: In function \u2018main\u2019:
sftptest.c:26: warning: unused variable \u2018mem\u2019
/usr/local/lib/libssh2.a(hostkey.o): In function `hostkey_method_ssh_rsa_signv':
/root/libssh2-1.2.8-20101011/src/hostkey.c:173: undefined reference to
`EVP_get_digestbyname'
/root/libssh2-1.2.8-20101011/src/hostkey.c:173: undefined reference to
`EVP_DigestInit'
/root/libssh2-1.2.8-20101011/src/hostkey.c:175: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/hostkey.c:177: undefined reference to
`EVP_DigestFinal'
/usr/local/lib/libssh2.a(hostkey.o): In function `hostkey_method_ssh_rsa_dtor':
/root/libssh2-1.2.8-20101011/src/hostkey.c:199: undefined reference to
`RSA_free'
/usr/local/lib/libssh2.a(hostkey.o): In function `hostkey_method_ssh_dss_signv':
/root/libssh2-1.2.8-20101011/src/hostkey.c:358: undefined reference to
`EVP_get_digestbyname'
/root/libssh2-1.2.8-20101011/src/hostkey.c:358: undefined reference to
`EVP_DigestInit'
/root/libssh2-1.2.8-20101011/src/hostkey.c:360: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/hostkey.c:362: undefined reference to
`EVP_DigestFinal'
/usr/local/lib/libssh2.a(hostkey.o): In function `hostkey_method_ssh_dss_dtor':
/root/libssh2-1.2.8-20101011/src/hostkey.c:383: undefined reference to
`DSA_free'
/usr/local/lib/libssh2.a(transport.o): In function `_libssh2_transport_write':
/root/libssh2-1.2.8-20101011/src/transport.c:785: undefined reference to
`RAND_bytes'
/usr/local/lib/libssh2.a(openssl.o): In function `_libssh2_rsa_new':
/root/libssh2-1.2.8-20101011/src/openssl.c:69: undefined reference to `RSA_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:71: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:72: undefined reference to
`BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/openssl.c:74: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:75: undefined reference to
`BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/openssl.c:78: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:79: undefined reference to
`BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/openssl.c:81: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:82: undefined reference to
`BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/openssl.c:84: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:85: undefined reference to
`BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/openssl.c:87: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:88: undefined reference to
`BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/openssl.c:90: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:91: undefined reference to
`BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/openssl.c:93: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:94: undefined reference to
`BN_bin2bn'
/usr/local/lib/libssh2.a(openssl.o): In function `_libssh2_rsa_sha1_verify':
/root/libssh2-1.2.8-20101011/src/openssl.c:109: undefined reference to
`RSA_verify'
/usr/local/lib/libssh2.a(openssl.o): In function `_libssh2_dsa_new':
/root/libssh2-1.2.8-20101011/src/openssl.c:127: undefined reference to `DSA_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:129: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:130: undefined reference to
`BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/openssl.c:132: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:133: undefined reference to
`BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/openssl.c:135: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:136: undefined reference to
`BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/openssl.c:138: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:139: undefined reference to
`BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/openssl.c:142: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:143: undefined reference to
`BN_bin2bn'
/usr/local/lib/libssh2.a(openssl.o): In function `_libssh2_dsa_sha1_verify':
/root/libssh2-1.2.8-20101011/src/openssl.c:158: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:159: undefined reference to
`BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/openssl.c:160: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/openssl.c:161: undefined reference to
`BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/openssl.c:164: undefined reference to
`DSA_do_verify'
/root/libssh2-1.2.8-20101011/src/openssl.c:165: undefined reference to
`BN_clear_free'
/root/libssh2-1.2.8-20101011/src/openssl.c:166: undefined reference to
`BN_clear_free'
/usr/local/lib/libssh2.a(openssl.o): In function `_libssh2_cipher_init':
/root/libssh2-1.2.8-20101011/src/openssl.c:177: undefined reference to
`EVP_CIPHER_CTX_init'
/root/libssh2-1.2.8-20101011/src/openssl.c:178: undefined reference to
`EVP_CipherInit'
/usr/local/lib/libssh2.a(openssl.o): In function `_libssh2_cipher_crypt':
/root/libssh2-1.2.8-20101011/src/openssl.c:197: undefined reference to
`EVP_Cipher'
/usr/local/lib/libssh2.a(openssl.o): In function `aes_ctr_init':
/root/libssh2-1.2.8-20101011/src/openssl.c:229: undefined reference to
`EVP_aes_128_ecb'
/root/libssh2-1.2.8-20101011/src/openssl.c:232: undefined reference to
`EVP_aes_192_ecb'
/root/libssh2-1.2.8-20101011/src/openssl.c:235: undefined reference to
`EVP_aes_256_ecb'
/root/libssh2-1.2.8-20101011/src/openssl.c:244: undefined reference to
`EVP_EncryptInit'
/root/libssh2-1.2.8-20101011/src/openssl.c:248: undefined reference to
`EVP_CIPHER_CTX_set_padding'
/root/libssh2-1.2.8-20101011/src/openssl.c:252: undefined reference to
`EVP_CIPHER_CTX_set_app_data'
/usr/local/lib/libssh2.a(openssl.o): In function `aes_ctr_do_cipher':
/root/libssh2-1.2.8-20101011/src/openssl.c:262: undefined reference to
`EVP_CIPHER_CTX_get_app_data'
/root/libssh2-1.2.8-20101011/src/openssl.c:281: undefined reference to
`EVP_EncryptUpdate'
/usr/local/lib/libssh2.a(openssl.o): In function `aes_ctr_cleanup':
/root/libssh2-1.2.8-20101011/src/openssl.c:301: undefined reference to
`EVP_CIPHER_CTX_get_app_data'
/usr/local/lib/libssh2.a(openssl.o): In function `read_private_key_from_file':
/root/libssh2-1.2.8-20101011/src/openssl.c:383: undefined reference to
`BIO_new_file'
/root/libssh2-1.2.8-20101011/src/openssl.c:391: undefined reference to
`BIO_free'
/usr/local/lib/libssh2.a(openssl.o): In function `_libssh2_rsa_new_private':
/root/libssh2-1.2.8-20101011/src/openssl.c:401: undefined reference to
`PEM_read_bio_RSAPrivateKey'
/usr/local/lib/libssh2.a(openssl.o): In function `_libssh2_dsa_new_private':
/root/libssh2-1.2.8-20101011/src/openssl.c:417: undefined reference to
`PEM_read_bio_DSAPrivateKey'
/usr/local/lib/libssh2.a(openssl.o): In function `_libssh2_rsa_sha1_sign':
/root/libssh2-1.2.8-20101011/src/openssl.c:438: undefined reference to
`RSA_size'
/root/libssh2-1.2.8-20101011/src/openssl.c:445: undefined reference to
`RSA_sign'
/usr/local/lib/libssh2.a(openssl.o): In function `_libssh2_dsa_sha1_sign':
/root/libssh2-1.2.8-20101011/src/openssl.c:468: undefined reference to
`DSA_do_sign'
/root/libssh2-1.2.8-20101011/src/openssl.c:473: undefined reference to
`BN_num_bits'
/root/libssh2-1.2.8-20101011/src/openssl.c:475: undefined reference to
`DSA_SIG_free'
/root/libssh2-1.2.8-20101011/src/openssl.c:478: undefined reference to
`BN_num_bits'
/root/libssh2-1.2.8-20101011/src/openssl.c:480: undefined reference to
`DSA_SIG_free'
/root/libssh2-1.2.8-20101011/src/openssl.c:486: undefined reference to
`BN_bn2bin'
/root/libssh2-1.2.8-20101011/src/openssl.c:487: undefined reference to
`BN_bn2bin'
/root/libssh2-1.2.8-20101011/src/openssl.c:489: undefined reference to
`DSA_SIG_free'
/usr/local/lib/libssh2.a(openssl.o): In function `libssh2_sha1':
/root/libssh2-1.2.8-20101011/src/openssl.c:501: undefined reference to
`EVP_get_digestbyname'
/root/libssh2-1.2.8-20101011/src/openssl.c:501: undefined reference to
`EVP_DigestInit'
/root/libssh2-1.2.8-20101011/src/openssl.c:502: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/openssl.c:503: undefined reference to
`EVP_DigestFinal'
/usr/local/lib/libssh2.a(openssl.o): In function `libssh2_md5':
/root/libssh2-1.2.8-20101011/src/openssl.c:512: undefined reference to
`EVP_get_digestbyname'
/root/libssh2-1.2.8-20101011/src/openssl.c:512: undefined reference to
`EVP_DigestInit'
/root/libssh2-1.2.8-20101011/src/openssl.c:513: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/openssl.c:514: undefined reference to
`EVP_DigestFinal'
/usr/local/lib/libssh2.a(global.o): In function `libssh2_init':
/root/libssh2-1.2.8-20101011/src/global.c:48: undefined reference to
`OPENSSL_add_all_algorithms_noconf'
/usr/local/lib/libssh2.a(channel.o): In function `channel_x11_req':
/root/libssh2-1.2.8-20101011/src/channel.c:1153: undefined reference to
`RAND_bytes'
/usr/local/lib/libssh2.a(kex.o): In function `diffie_hellman_sha1':
/root/libssh2-1.2.8-20101011/src/kex.c:95: undefined reference to `BN_CTX_new'
/root/libssh2-1.2.8-20101011/src/kex.c:96: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/kex.c:97: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/kex.c:98: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/kex.c:99: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/kex.c:105: undefined reference to `BN_rand'
/root/libssh2-1.2.8-20101011/src/kex.c:106: undefined reference to `BN_mod_exp'
/root/libssh2-1.2.8-20101011/src/kex.c:112: undefined reference to `BN_num_bits'
/root/libssh2-1.2.8-20101011/src/kex.c:113: undefined reference to `BN_num_bits'
/root/libssh2-1.2.8-20101011/src/kex.c:128: undefined reference to `BN_num_bits'
/root/libssh2-1.2.8-20101011/src/kex.c:129: undefined reference to `BN_bn2bin'
/root/libssh2-1.2.8-20101011/src/kex.c:133: undefined reference to `BN_bn2bin'
/root/libssh2-1.2.8-20101011/src/kex.c:219: undefined reference to
`EVP_get_digestbyname'
/root/libssh2-1.2.8-20101011/src/kex.c:219: undefined reference to
`EVP_DigestInit'
/root/libssh2-1.2.8-20101011/src/kex.c:220: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:222: undefined reference to
`EVP_DigestFinal'
/root/libssh2-1.2.8-20101011/src/kex.c:241: undefined reference to
`EVP_get_digestbyname'
/root/libssh2-1.2.8-20101011/src/kex.c:241: undefined reference to
`EVP_DigestInit'
/root/libssh2-1.2.8-20101011/src/kex.c:242: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:244: undefined reference to
`EVP_DigestFinal'
/root/libssh2-1.2.8-20101011/src/kex.c:272: undefined reference to `BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/kex.c:280: undefined reference to `BN_mod_exp'
/root/libssh2-1.2.8-20101011/src/kex.c:282: undefined reference to `BN_num_bits'
/root/libssh2-1.2.8-20101011/src/kex.c:283: undefined reference to `BN_num_bits'
/root/libssh2-1.2.8-20101011/src/kex.c:296: undefined reference to `BN_num_bits'
/root/libssh2-1.2.8-20101011/src/kex.c:297: undefined reference to `BN_bn2bin'
/root/libssh2-1.2.8-20101011/src/kex.c:300: undefined reference to `BN_bn2bin'
/root/libssh2-1.2.8-20101011/src/kex.c:303: undefined reference to
`EVP_get_digestbyname'
/root/libssh2-1.2.8-20101011/src/kex.c:303: undefined reference to
`EVP_DigestInit'
/root/libssh2-1.2.8-20101011/src/kex.c:307: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:309: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:315: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:317: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:324: undefined reference to
`EVP_DigestUpdate'
/usr/local/lib/libssh2.a(kex.o):/root/libssh2-1.2.8-20101011/src/kex.c:326: more
undefined references to `EVP_DigestUpdate' follow
/usr/local/lib/libssh2.a(kex.o): In function `diffie_hellman_sha1':
/root/libssh2-1.2.8-20101011/src/kex.c:394: undefined reference to
`EVP_DigestFinal'
/root/libssh2-1.2.8-20101011/src/kex.c:468: undefined reference to
`EVP_get_digestbyname'
/root/libssh2-1.2.8-20101011/src/kex.c:468: undefined reference to
`EVP_DigestInit'
/root/libssh2-1.2.8-20101011/src/kex.c:468: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:468: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:468: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:468: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:468: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:468: undefined reference to
`EVP_DigestFinal'
/root/libssh2-1.2.8-20101011/src/kex.c:475: undefined reference to
`EVP_get_digestbyname'
/root/libssh2-1.2.8-20101011/src/kex.c:475: undefined reference to
`EVP_DigestInit'
/root/libssh2-1.2.8-20101011/src/kex.c:475: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:475: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:475: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:475: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:475: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:475: undefined reference to
`EVP_DigestFinal'
/root/libssh2-1.2.8-20101011/src/kex.c:515: undefined reference to
`EVP_get_digestbyname'
/root/libssh2-1.2.8-20101011/src/kex.c:515: undefined reference to
`EVP_DigestInit'
/root/libssh2-1.2.8-20101011/src/kex.c:515: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:515: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:515: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:515: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:515: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:515: undefined reference to
`EVP_DigestFinal'
/root/libssh2-1.2.8-20101011/src/kex.c:522: undefined reference to
`EVP_get_digestbyname'
/root/libssh2-1.2.8-20101011/src/kex.c:522: undefined reference to
`EVP_DigestInit'
/root/libssh2-1.2.8-20101011/src/kex.c:522: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:522: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:522: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:522: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:522: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:522: undefined reference to
`EVP_DigestFinal'
/root/libssh2-1.2.8-20101011/src/kex.c:560: undefined reference to
`EVP_get_digestbyname'
/root/libssh2-1.2.8-20101011/src/kex.c:560: undefined reference to
`EVP_DigestInit'
/root/libssh2-1.2.8-20101011/src/kex.c:560: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:560: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:560: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:560: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:560: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:560: undefined reference to
`EVP_DigestFinal'
/root/libssh2-1.2.8-20101011/src/kex.c:586: undefined reference to
`EVP_get_digestbyname'
/root/libssh2-1.2.8-20101011/src/kex.c:586: undefined reference to
`EVP_DigestInit'
/root/libssh2-1.2.8-20101011/src/kex.c:586: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:586: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:586: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:586: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:586: undefined reference to
`EVP_DigestUpdate'
/root/libssh2-1.2.8-20101011/src/kex.c:586: undefined reference to
`EVP_DigestFinal'
/root/libssh2-1.2.8-20101011/src/kex.c:640: undefined reference to
`BN_clear_free'
/root/libssh2-1.2.8-20101011/src/kex.c:642: undefined reference to
`BN_clear_free'
/root/libssh2-1.2.8-20101011/src/kex.c:644: undefined reference to
`BN_clear_free'
/root/libssh2-1.2.8-20101011/src/kex.c:646: undefined reference to
`BN_clear_free'
/root/libssh2-1.2.8-20101011/src/kex.c:648: undefined reference to `BN_CTX_free'
/usr/local/lib/libssh2.a(kex.o): In function
`kex_method_diffie_hellman_group1_sha1_key_exchange':
/root/libssh2-1.2.8-20101011/src/kex.c:704: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/kex.c:705: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/kex.c:708: undefined reference to `BN_set_word'
/root/libssh2-1.2.8-20101011/src/kex.c:709: undefined reference to `BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/kex.c:723: undefined reference to
`BN_clear_free'
/root/libssh2-1.2.8-20101011/src/kex.c:725: undefined reference to
`BN_clear_free'
/usr/local/lib/libssh2.a(kex.o): In function
`kex_method_diffie_hellman_group14_sha1_key_exchange':
/root/libssh2-1.2.8-20101011/src/kex.c:779: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/kex.c:780: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/kex.c:784: undefined reference to `BN_set_word'
/root/libssh2-1.2.8-20101011/src/kex.c:785: undefined reference to `BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/kex.c:800: undefined reference to
`BN_clear_free'
/root/libssh2-1.2.8-20101011/src/kex.c:802: undefined reference to
`BN_clear_free'
/usr/local/lib/libssh2.a(kex.o): In function
`kex_method_diffie_hellman_group_exchange_sha1_key_exchange':
/root/libssh2-1.2.8-20101011/src/kex.c:823: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/kex.c:824: undefined reference to `BN_new'
/root/libssh2-1.2.8-20101011/src/kex.c:878: undefined reference to `BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/kex.c:883: undefined reference to `BN_bin2bn'
/root/libssh2-1.2.8-20101011/src/kex.c:900: undefined reference to
`BN_clear_free'
/root/libssh2-1.2.8-20101011/src/kex.c:902: undefined reference to
`BN_clear_free'
/usr/local/lib/libssh2.a(kex.o): In function `kexinit':
/root/libssh2-1.2.8-20101011/src/kex.c:1067: undefined reference to `RAND_bytes'
/usr/local/lib/libssh2.a(mac.o): In function `mac_method_hmac_sha1_hash':
/root/libssh2-1.2.8-20101011/src/mac.c:116: undefined reference to `EVP_sha1'
/root/libssh2-1.2.8-20101011/src/mac.c:116: undefined reference to `HMAC_Init'
/root/libssh2-1.2.8-20101011/src/mac.c:117: undefined reference to `HMAC_Update'
/root/libssh2-1.2.8-20101011/src/mac.c:118: undefined reference to `HMAC_Update'
/root/libssh2-1.2.8-20101011/src/mac.c:120: undefined reference to `HMAC_Update'
/root/libssh2-1.2.8-20101011/src/mac.c:122: undefined reference to `HMAC_Final'
/root/libssh2-1.2.8-20101011/src/mac.c:123: undefined reference to
`HMAC_CTX_cleanup'
/usr/local/lib/libssh2.a(mac.o): In function `mac_method_hmac_md5_hash':
/root/libssh2-1.2.8-20101011/src/mac.c:188: undefined reference to `EVP_md5'
/root/libssh2-1.2.8-20101011/src/mac.c:188: undefined reference to `HMAC_Init'
/root/libssh2-1.2.8-20101011/src/mac.c:189: undefined reference to `HMAC_Update'
/root/libssh2-1.2.8-20101011/src/mac.c:190: undefined reference to `HMAC_Update'
/root/libssh2-1.2.8-20101011/src/mac.c:192: undefined reference to `HMAC_Update'
/root/libssh2-1.2.8-20101011/src/mac.c:194: undefined reference to `HMAC_Final'
/root/libssh2-1.2.8-20101011/src/mac.c:195: undefined reference to
`HMAC_CTX_cleanup'
/usr/local/lib/libssh2.a(mac.o): In function `mac_method_hmac_ripemd160_hash':
/root/libssh2-1.2.8-20101011/src/mac.c:260: undefined reference to
`EVP_ripemd160'
/root/libssh2-1.2.8-20101011/src/mac.c:260: undefined reference to `HMAC_Init'
/root/libssh2-1.2.8-20101011/src/mac.c:261: undefined reference to `HMAC_Update'
/root/libssh2-1.2.8-20101011/src/mac.c:262: undefined reference to `HMAC_Update'
/root/libssh2-1.2.8-20101011/src/mac.c:264: undefined reference to `HMAC_Update'
/root/libssh2-1.2.8-20101011/src/mac.c:266: undefined reference to `HMAC_Final'
/root/libssh2-1.2.8-20101011/src/mac.c:267: undefined reference to
`HMAC_CTX_cleanup'
/usr/local/lib/libssh2.a(comp.o): In function `comp_method_zlib_init':
/root/libssh2-1.2.8-20101011/src/comp.c:137: undefined reference to
`deflateInit_'
/root/libssh2-1.2.8-20101011/src/comp.c:140: undefined reference to
`inflateInit_'
/usr/local/lib/libssh2.a(comp.o): In function `comp_method_zlib_comp':
/root/libssh2-1.2.8-20101011/src/comp.c:206: undefined reference to `deflate'
/root/libssh2-1.2.8-20101011/src/comp.c:208: undefined reference to `inflate'
/root/libssh2-1.2.8-20101011/src/comp.c:274: undefined reference to `deflate'
/root/libssh2-1.2.8-20101011/src/comp.c:276: undefined reference to `inflate'
/usr/local/lib/libssh2.a(comp.o): In function `comp_method_zlib_dtor':
/root/libssh2-1.2.8-20101011/src/comp.c:306: undefined reference to `deflateEnd'
/root/libssh2-1.2.8-20101011/src/comp.c:309: undefined reference to `inflateEnd'
/usr/local/lib/libssh2.a(crypt.o): In function `crypt_dtor':
/root/libssh2-1.2.8-20101011/src/crypt.c:111: undefined reference to
`EVP_CIPHER_CTX_cleanup'
/usr/local/lib/libssh2.a(crypt.o):(.rodata+0x100): undefined reference to
`EVP_aes_128_cbc'
/usr/local/lib/libssh2.a(crypt.o):(.rodata+0x140): undefined reference to
`EVP_aes_192_cbc'
/usr/local/lib/libssh2.a(crypt.o):(.rodata+0x180): undefined reference to
`EVP_aes_256_cbc'
/usr/local/lib/libssh2.a(crypt.o):(.rodata+0x1c0): undefined reference to
`EVP_aes_256_cbc'
/usr/local/lib/libssh2.a(crypt.o):(.rodata+0x200): undefined reference to
`EVP_bf_cbc'
/usr/local/lib/libssh2.a(crypt.o):(.rodata+0x240): undefined reference to
`EVP_rc4'
/usr/local/lib/libssh2.a(crypt.o):(.rodata+0x280): undefined reference to
`EVP_rc4'
/usr/local/lib/libssh2.a(crypt.o):(.rodata+0x2c0): undefined reference to
`EVP_cast5_cbc'
/usr/local/lib/libssh2.a(crypt.o):(.rodata+0x300): undefined reference to
`EVP_des_ede3_cbc'
collect2: ld returned 1 exit status
root_at_server: /data/work >

also adding -lssl has no impact.
Using gcc 4.4 (32-Bit) on Suse 11.0

Another point is, when I do dynamical linking like: 'gcc -o sftptest sftptest.c
-lssh2' everything works fine ...
But in this case I need the statical linked version since the target box doesn't
have the libraries needed to run the binary.

TIA
may

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-10-19