Actually, I was advised to put libssl after libcrypto.  I don't recall being 
told to put libssl after libldap.  Also, knowing that order matters is of 
little use if you don't grasp what the order should be.  

I did show  the link command in a previous post, but admittedly not up to date 
with this particular set of errors.  I'll remember to include my link command 
with every example of error messages.  

I have achived partial success today by including some static libraries in the 
link command along with my own object files, rather than linking them in as 
libraries, but I am far from being able to use the -static flag.  In several 
experiments I tried in the afternoon, I could get the thing to the point where 
all the errors were comin from ldap, but there were many.  

I will try to be more informative in future posts.  The advice I have received 
here so far has taught me a lot.

Brandon




-----Original Message-----
From: Jeremy Farrell <jfarr...@pillardata.com>
To: openssl-users <openssl-users@openssl.org>
Sent: Mon, Jul 18, 2011 3:38 pm
Subject: RE: Trying to Link Statically to Libcrypto


The output is little or no help in knowing specifically what you've done wrong, 
What link command line did you use?
 
The most likely explanation of this is that you still haven't done what several 
different people here have advised you several times, including in the messages 
quoted below - made sure that the reference to the OpenSSL libraries comes 
_AFTER_ the references to the ldap library in the link command. As everyone 
keeps saying, _order_matters_.
 
I don't recognise the names of some of the missing references below; they may 
be OpenSSL references I'm not aware of, or they may be to some other library 
which the ldap library needs. If its the latter, you'll need to look at the 
documentation of the ldap library to see what it needs, and include it on the 
link command line. Since _order_matters_, you'll need to include it _after_ the 
reference to the ldap library.


From: brandon...@aol.com
Sent: Monday, July 18, 2011 4:46 PM



I put the -static where it belongs.  Here is a partial list of the output:
 
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_sb_close':
(.text+0xa6): undefined reference to `SSL_shutdown'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_upflags':
(.text+0x13b): undefined reference to `SSL_get_error'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_sb_write':
(.text+0x1cc): undefined reference to `SSL_write'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_sb_write':
(.text+0x1df): undefined reference to `SSL_get_error'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_sb_read':
(.text+0x2cc): undefined reference to `SSL_read'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_sb_read':
(.text+0x2df): undefined reference to `SSL_get_error'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_sb_ctrl':
(.text+0x409): undefined reference to `SSL_pending'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_sb_remove':
(.text+0x4ab): undefined reference to `SSL_free'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_sb_setup':
(.text+0x58f): undefined reference to `SSL_set_bio'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_strength':
(.text+0x769): undefined reference to `SSL_get_current_cipher'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_strength':
(.text+0x779): undefined reference to `SSL_CIPHER_get_bits'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_get_cert':
(.text+0x7ad): undefined reference to `SSL_get_verify_result'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_get_cert':
(.text+0x7bd): undefined reference to `SSL_get_peer_certificate'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_chkhost':
(.text+0x8a6): undefined reference to `X509_get_ext_by_NID'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_chkhost':
(.text+0x8bd): undefined reference to `X509_get_ext'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_chkhost':
(.text+0x8c5): undefined reference to `X509V3_EXT_d2i'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_chkhost':
(.text+0x9be): undefined reference to `GENERAL_NAMES_free'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_chkhost':
(.text+0x9d7): undefined reference to `GENERAL_NAMES_free'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_chkhost':
(.text+0x9f5): undefined reference to `X509_get_subject_name'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_chkhost':
(.text+0xa00): undefined reference to `X509_NAME_entry_count'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_chkhost':
(.text+0xa1b): undefined reference to `X509_NAME_get_entry'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_chkhost':
(.text+0xa98): undefined reference to `X509_free'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_chkhost':
(.text+0xc62): undefined reference to `X509_NAME_ENTRY_get_data'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_peer_dn':
(.text+0xe04): undefined reference to `X509_get_subject_name'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_peer_dn':
(.text+0xe17): undefined reference to `i2d_X509_NAME'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_peer_dn':
(.text+0xe2d): undefined reference to `X509_free'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_my_dn':
(.text+0xe64): undefined reference to `SSL_get_certificate'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_my_dn':
(.text+0xe77): undefined reference to `X509_get_subject_name'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_my_dn':
(.text+0xe8a): undefined reference to `i2d_X509_NAME'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_my_dn':
(.text+0xea0): undefined reference to `X509_free'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_errmsg':
(.text+0xf07): undefined reference to `ERR_error_string_n'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_accept':
(.text+0xf39): undefined reference to `SSL_accept'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_connect':
(.text+0xf69): undefined reference to `SSL_connect'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_session_new':
(.text+0xf99): undefined reference to `SSL_new'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_report_error':
(.text+0x101e): undefined reference to `ERR_error_string_n'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x10ef): undefined reference to `SSL_CTX_set_cipher_list'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x111e): undefined reference to `SSL_CTX_load_verify_locations'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x1131): undefined reference to `SSL_CTX_set_default_verify_paths'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x1164): undefined reference to `SSL_CTX_use_certificate_file'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x1190): undefined reference to `SSL_CTX_use_PrivateKey_file'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x11ef): undefined reference to `PEM_read_bio_DHparams'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x1217): undefined reference to `DH_size'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x1254): undefined reference to `SSL_CTX_set_info_callback'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x127d): undefined reference to `SSL_CTX_set_verify'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x1292): undefined reference to `SSL_CTX_set_tmp_rsa_callback'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x12b1): undefined reference to `SSL_CTX_set_tmp_dh_callback'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x12e3): undefined reference to `SSL_load_client_CA_file'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x130b): undefined reference to `SSL_add_dir_cert_subjects_to_stack'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x139f): undefined reference to `SSL_CTX_get_cert_store'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x13c7): undefined reference to `X509_STORE_set_flags'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x13eb): undefined reference to `SSL_CTX_set_client_CA_list'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x1447): undefined reference to `SSL_CTX_ctrl'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x1469): undefined reference to `SSL_CTX_set_session_id_context'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x1497): undefined reference to `SSL_CTX_ctrl'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_init':
(.text+0x155a): undefined reference to `X509_STORE_set_flags'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_tmp_dh_cb':
(.text+0x173f): undefined reference to `PEM_read_bio_DHparams'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_tmp_dh_cb':
(.text+0x17c0): undefined reference to `DH_generate_parameters'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_tmp_rsa_cb':
(.text+0x1809): undefined reference to `RSA_generate_key'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_verify_cb':
(.text+0x189e): undefined reference to `X509_STORE_CTX_get_current_cert'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_verify_cb':
(.text+0x18ab): undefined reference to `X509_STORE_CTX_get_error'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_verify_cb':
(.text+0x18b9): undefined reference to `X509_STORE_CTX_get_error_depth'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_verify_cb':
(.text+0x18c4): undefined reference to `X509_get_subject_name'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_verify_cb':
(.text+0x18cf): undefined reference to `X509_get_issuer_name'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_verify_cb':
(.text+0x18ec): undefined reference to `X509_NAME_oneline'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_verify_cb':
(.text+0x1907): undefined reference to `X509_NAME_oneline'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_verify_cb':
(.text+0x19f7): undefined reference to `X509_verify_cert_error_string'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_info_cb':
(.text+0x1a87): undefined reference to `SSL_state_string_long'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_info_cb':
(.text+0x1b3c): undefined reference to `SSL_alert_type_string_long'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_info_cb':
(.text+0x1b47): undefined reference to `SSL_alert_desc_string_long'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_free':
(.text+0x1c49): undefined reference to `SSL_CTX_free'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_new':
(.text+0x1cc3): undefined reference to `SSLv23_method'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_ctx_new':
(.text+0x1ccb): undefined reference to `SSL_CTX_new'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_destroy':
(.text+0x1cf8): undefined reference to `EVP_cleanup'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_destroy':
(.text+0x1d09): undefined reference to `ERR_free_strings'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_init':
(.text+0x1d53): undefined reference to `SSL_load_error_strings'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_init':
(.text+0x1d58): undefined reference to `SSL_library_init'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(tls_o.o): In function 
`tlso_init':
(.text+0x1d5d): undefined reference to `X509V3_add_standard_extensions'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_external':
(.text+0x69): undefined reference to `sasl_setprop'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_external':
(.text+0x84): undefined reference to `sasl_setprop'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`sb_sasl_cyrus_init':
(.text+0xbb): undefined reference to `sasl_getprop'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`.L41':
(.text+0x488): undefined reference to `sasl_setprop'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_close':
(.text+0x7be): undefined reference to `sasl_dispose'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_close':
(.text+0x7d5): undefined reference to `sasl_dispose'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`sb_sasl_cyrus_decode':
(.text+0x94b): undefined reference to `sasl_decode'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`sb_sasl_cyrus_decode':
(.text+0x97c): undefined reference to `sasl_errstring'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`sb_sasl_cyrus_encode':
(.text+0x9f8): undefined reference to `sasl_encode'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`sb_sasl_cyrus_encode':
(.text+0xa2c): undefined reference to `sasl_errstring'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_init':
(.text+0xa8d): undefined reference to `sasl_version'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_init':
(.text+0xb29): undefined reference to `sasl_client_init'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`.L146':
(.text+0xbf2): undefined reference to `sasl_global_listmech'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`.L152':
(.text+0xc4e): undefined reference to `sasl_getprop'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_open':
(.text+0xd57): undefined reference to `sasl_client_new'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_bind':
(.text+0xf6d): undefined reference to `sasl_dispose'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_bind':
(.text+0x108f): undefined reference to `sasl_setprop'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_bind':
(.text+0x1120): undefined reference to `sasl_client_start'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_bind':
(.text+0x131a): undefined reference to `sasl_client_step'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_bind':
(.text+0x13a9): undefined reference to `sasl_errdetail'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_bind':
(.text+0x1582): undefined reference to `sasl_getprop'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_bind':
(.text+0x15b3): undefined reference to `sasl_getprop'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_bind':
(.text+0x1618): undefined reference to `sasl_dispose'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_bind':
(.text+0x1799): undefined reference to `sasl_errdetail'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(cyrus.o): In function 
`ldap_int_sasl_bind':
(.text+0x1807): undefined reference to `sasl_errdetail'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(gssapi.o): In function 
`ldap_int_gssapi_close':
(.text+0x374): undefined reference to `gss_inquire_context'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(gssapi.o): In function 
`ldap_int_gssapi_close':
(.text+0x3cb): undefined reference to `gss_delete_sec_context'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(gssapi.o): In function 
`ldap_int_gssapi_setup':
(.text+0x454): undefined reference to `gss_inquire_context'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(gssapi.o): In function 
`gsserrstr.clone.0':
(.text+0x65a): undefined reference to `gss_display_status'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(gssapi.o): In function 
`gsserrstr.clone.0':
(.text+0x689): undefined reference to `gss_display_status'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(gssapi.o): In function 
`gsserrstr.clone.0':
(.text+0x71e): undefined reference to `gss_release_buffer'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(gssapi.o): In function 
`gsserrstr.clone.0':
(.text+0x72d): undefined reference to `gss_release_buffer'
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.a(gssapi.o): In function 
`gsserrstr.clone.0':


-----Original Message-----
From: brandonshw <brandon...@aol.com>
To: openssl-users <openssl-users@openssl.org>
Sent: Sun, Jul 17, 2011 6:32 pm
Subject: Re: Trying to Link Statically to Libcrypto


Some incredibly helpful advice, which I appreciate very much.  I'll apply it 
all tomorrow  morning.  It makes a lot of 
sense to find out that I've been putting the -static flag in the wrong place, 
because I had to develop scripts to temporarily
hide shared libraries from the linker, whenever I made a version of my 
executable to be used or tested elsewhere, to force 
the linker to chose the static versions.  I wondered why the -static flag 
wasn't working.  In my present job, I only have time 
to research new  things briefly, and not at length as I would prefer.
 
Brandon





-----Original Message-----
From: Michael S. Zick <open...@morethan.org>
To: openssl-users <openssl-users@openssl.org>
Sent: Sun, Jul 17, 2011 4:48 pm
Subject: Re: Trying to Link Statically to Libcrypto


On Sun July 17 2011, brandon...@aol.com wrote:
 
 Although I've been programming on various platforms for quite awhile, I don't 
now  much about the principles involved here - i.e. Linux or static vs dynamix 
inking.  You are right, it is linking to libldap.
 
 What I am trying to do is remove all dependencies on libraries on the diverse 
arget machines, so that it works right out of the box without the necessity of 
he user installing libraries.  On several machines where people have installed 
y program, it complained that it couldn't find libcrypto.so.8.  I fixed that on 
hose occasions by creating a symbolic link to their actual version of 
ibcrypto, but I just want it to stop looking for any library at all on the box 
here I'm putting it, and this  is one step towards that.  I had hoped that by 
orcing it to take libcrypto.a, rather than libcrypto.so, it would stop looking 
or libcrypto.so.8.
 
When you pass -static to the linker as part of the link command,
t will search for libcrypto.a rather than the default (dynamic)
ibcrypto.so (which should be a sym-link to the current version
amed libcrypto.so.VERSION-NUMBER).
Also remember that the application: /usr/bin/g++ which you are
alling is just the "front end" of that toolchain.
t calls the sub-components (pre-processor, compiler, assembler,
inker, etc) as required based on the options and files it is passed.
Note also when you did:
++ --help
n a terminal window that the order is:
++ <options> files
ot:
++ files <options>
Also try:
nfo g++
n a terminal window.
Mike
> From: Andreas Mueller <andreas.muel...@othello.ch>
 To: openssl-users <openssl-users@openssl.org>
 Sent: Sun, Jul 17, 2011 2:45 pm
 Subject: Re: Trying to Link Statically to Libcrypto
 
 
 Brandon,
 Am 16.07.2011 um 10:59 schrieb brandon...@aol.com:
  Actually, I believe it said that openldap.so was complaining that they were
 t  would certainly help if you actually knew what it was saying,
 ot just believed it!   And  wasn't  it  rather  libldap.so,  not
 penldap.so.  Of  course,  libldap.so is usually provided by some
 penldap package.
 > I am already linking in -lldap.  Will -lopenldap work better?
 e certainly meant -lldap (the library is called  libldap.so,  so
 he  linker  flag  is  called  -lldap). If your library really is
 alled openldap.so (which I very much doubt), then  you  can  not
 ink  it  with the -l option, you have to add the fully qualified
 ath name of that library to the linker command line.
 > > Any idea what library I can link in to define the above two references?
  Link to OpenSSL first, and then OpenLdap (order matters):
 
  gcc ... -lcrypto -lopenldap
 hat was meant is "-lldap -lcrypto".  Libraries  later  in  later
 lags  have to satisfy references left open by earlier libraries.
 > I am writing some C++ on Linux with g++. When I try to link statically to
  libcrypto, by using the libcrypto.a library, it complains that
 ou are linking statically to a library that some other  library,
 amely  libldap,  want's to link dynamically. How's that supposed
 o work? Static linking means you have a  copy  of  libcrypto  in
 our  binary,  with  the symbols of that library removed, because
 hey have already been resolved. Then libldap  gets  linked,  and
 ants to know about the same symbols once again, so a shared copy
 f the library libcrypto has to be added to  the  address  space.
 hat  a mess. So the real question is: WTH are you trying to link
 tatically!
 Mit herzlichem Gruss
                                         Andreas Müller




Reply via email to