Okay, I am in to my office for few minutes to get the details. Here is how I am compiling and linking, and the error message I am getting. I have placed elipses (...) where the file and object names were. What do I need to do to get static linking to libcrypto.a to work?
g++ ... -O3 -Wall -static -c -fmessage-length=0 g++ -o ... -lz -lssl -lcrypto -lxml2 -lm -lldap and get the error: /usr/bin/ld: warning: libcrypto.so.8, needed by /usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libssl.so, not found (try using -rpath or -rpath-link) /usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.so: undefined reference to `RSA_generate_key' /usr/lib/gcc/i586-redhat-linux/4.4.1/../../../libldap.so: undefined reference to `DH_generate_parameters' collect2: ld returned 1 exit status -----Original Message----- From: brandonshw <brandon...@aol.com> To: openssl-users <openssl-users@openssl.org> Sent: Sat, Jul 16, 2011 11:40 am Subject: Re: Trying to Link Statically to Libcrypto Thanks. This is some very useful information and more than I knew. When I get back to work on Monday, or possibly before if I go in for a few minutes, I will send the full g++ command I am using as well as the error messages.. -----Original Message----- From: Michael S. Zick <open...@morethan.org> To: openssl-users <openssl-users@openssl.org> Sent: Sat, Jul 16, 2011 6:53 am Subject: Re: Trying to Link Statically to Libcrypto On Sat July 16 2011, brandon...@aol.com wrote: I am already linking in -lldap. Will -lopenldap work better? It is hard to say without seeing your full command input and he output of where the linker is looking for libraries and n what order. __order matters__ > link to OpenSSL first, and then OpenLdap (order matters): > gcc ... -lcrypto -lopenldap If doing the linking with the compiler driver, add: Wl,-t o the command options so the linker will output each library s it searches for symbols. If calling the linker directly, just add: t o the link command options The "-t" option is the "trace" option to the linker. Mike > Jeff _____________________________________________________________________ penSSL Project http://www.openssl.org ser Support Mailing List openssl-users@openssl.org utomated List Manager majord...@openssl.org