On 19.07.2011 16:49, brandon...@aol.com wrote:
*Okay, it is acting like my /usr/lib/libssl.a is of no value. First,
just for comparison, attempting to link with no reference to libssl at
all:*
Today at 14:23 you wrote "Thanks for the lesson. Highly informative.",
but now you're still doing it wrong :-(
Note that this will be my last message to this thread, since learning
linking order is OT here.
[root@linux Release]# g++ -o"<My exe name>" <my object file list>
/usr/lib/libcrypto.a /usr/lib/libldap.a /usr/lib/libxml2.a
/usr/lib/liblber.a -lz -ldl -lm -lsasl2 2>&1
Okay, libcrypto is *before* libldap, and libssl is missing (you wrote that).
snipping unused error messages...
/usr/lib/libldap.a(tls_o.o): In function `tlso_sb_close':
(.text+0xa6): undefined reference to `SSL_shutdown'
SSL_shutdown is still missing, because libssl is missing.
*Now, including /usr/lib/libssl.a at the end of the list of object file:*
[root@linux Release]# g++ -o"<My exe name>" <my object file list>
/usr/lib/libcrypto.a /usr/lib/libldap.a /usr/lib/libxml2.a
/usr/lib/liblber.a /usr/lib/libssl.a -lz -ldl -lm -lsasl2 2>&1
/usr/lib/libldap.a(tls_o.o): In function `tlso_session_chkhost':
(.text+0x8a6): undefined reference to `X509_get_ext_by_NID'
X509* functions are in libcrypto - you should have found
that out meanwhile. They can't be found by the linker because
libcrypto is *before* libldap!
Furthermore, now that you added libssl, SSL_shutdown
*is* found by the linker (not in the error list anymore).
*Now, including /usr/lib/libssl.a at the beginning of the list of
object file:*
Another useless try...
*Now, giving up and allowing it to choose the so version, suddenly
everything works. There are two warnings, but no errors.*
[root@linux Release]# g++ -o"<My exe name>" <my object file list>
/usr/lib/libcrypto.a /usr/lib/libldap.a /usr/lib/libxml2.a
/usr/lib/liblber.a -lz -ldl -lm -lssl -lsasl2 2>&1
/usr/lib/libldap.a(os-ip.o): In function `ldap_int_poll':
(.text+0x9c4): warning: `sys_errlist' is deprecated; use `strerror' or
`strerror_r' instead
/usr/lib/libldap.a(os-ip.o): In function `ldap_int_poll':
(.text+0x9ba): warning: `sys_nerr' is deprecated; use `strerror' or
`strerror_r' instead
[root@linux Release]#
Anyone have an idea why the static version of the library doesn't seem
to work?
Because if you link with the shared libraries, the linker adds the entire
libraries (symbols) to its internal list of known symbols, and thus it
can resolve all references. Check the order again, and then you'll be
able to link statically as well.
Hint: ldap - ssl - crypto - others...
--
Regards
Albrecht
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majord...@openssl.org