Openssl Link Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business undefined reference to aes_set_encrypt_key Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation
Statically Link Openssl
Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just
Gcc Openssl
like you, helping each other. Join them; it only takes a minute: Sign up Linking OpenSSL libraries to a program up vote 7 down vote favorite I have built OpenSSL from source (an intentionally old version; built with
Libcrypto Static Library
./config && make && make test) and would prefer to use what I have built without doing make install to link against my program. The command that's failing is: gcc -Wall -Wextra -Werror -static -Lopenssl/openssl-0.9.8k/ -lssl -lcrypto -Iopenssl/openssl-0.9.8k/include -o myApp source1.o source2.o common.o And I receive a series of errors similar to: common.c:(.text+0x1ea): undefined reference toSSL_write'` This makes me think there's something funky with my OpenSSL. If I omit -Lopenssl/openssl-0.9.8k/ from my command, the error undefined reference to `sha256_init' changes to being unable to: /usr/bin/ld: cannot find -lssl /usr/bin/ld: cannot find -lcrypto Am I compiling OpenSSL incorrectly? Or how should I best resolve this? linux gcc openssl share|improve this question edited Jun 19 '15 at 17:50 jww 35.7k21112225 asked Dec 4 '10 at 8:00 mrduclaw 2,19242129 add a comment| 2 Answers 2 active oldest votes up vote 13 down vote accepted Silly "Linux-isms" strike again! Apparently, I need to change my command such that the -L and -l stuff is at the end like (despite what man gcc seems to indicate): gcc -Wall -Wextra -Werror -static -o myApp source1.o source2.o common.o -Lopenssl/openssl-0.9.8k/ -lssl -lcrypto -Iopenssl/openssl-0.9.8k/include share|improve this answer edited Aug 6 '14 at 14:58 iammilind 37.5k1387188 answered Dec 4 '10 at 9:02 mrduclaw 2,19242129 8 It's the -lssl -lcrypto that need to be at the end. When a library is scanned by the linker, only the functions for which there are already undefined references are linked. So you need to put the "consuming" objects at the start of the link line, and the "supplying" objects at the end. –caf Dec 6 '10 at 1:35 This should be the accepted answer! –jweyrich Mar 28 '14 at 6:54 1 I'm always weird about accepting my own answers. I'll switch it now though. –mrduclaw Mar 29 '14 at 15:10 add a
here for a quick overview of the site Help Center Detailed answers to any questions you might have openssl configure options Meta Discuss the workings and policies of this site About Us lcrypto Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads undefined reference to `dlopen' with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, http://stackoverflow.com/questions/4352573/linking-openssl-libraries-to-a-program just like you, helping each other. Join them; it only takes a minute: Sign up Unresolved external Symbol OpenSSL Libraries C++ [duplicate] up vote 0 down vote favorite 1 This question already has an answer here: How to use OpenSSL with Visual Studio 3 answers What is an undefined reference/unresolved external symbol error and how do http://stackoverflow.com/questions/31646663/unresolved-external-symbol-openssl-libraries-c I fix it? 25 answers I'm trying to compile my program with Visual Studio 2013 C++, I have no errors until I compile. error LNK2001: unresolved external symbol _EVP_DecryptUpdate error LNK2001: unresolved external symbol _EVP_DecryptInit error LNK2001: unresolved external symbol _EVP_DecryptFinal error LNK2001: unresolved external symbol _EVP_CIPHER_CTX_new error LNK2001: unresolved external symbol _EVP_CIPHER_CTX_init error LNK2001: unresolved external symbol _EVP_CIPHER_CTX_free error LNK2001: unresolved external symbol _EVP_CIPHER_CTX_cleanup error LNK2001: unresolved external symbol _EVP_aes_128_cbc I'm using stock OpenSSL Libraries. I've successfully linked them to the openssl folder. How do I resolve this issue? c++ visual-c++ openssl share|improve this question edited Jul 27 '15 at 20:14 Niall 19.6k85083 asked Jul 27 '15 at 6:54 Gabriel Fraser 287 marked as duplicate by Niall, Deduplicatorc++ Users with the c++ badge can single-handedly close c++ questions as duplicates and reopen them as needed. Jul 30 '15 at 20:26 This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a n
communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions http://askubuntu.com/questions/194193/why-do-i-get-undefined-reference-errors-when-linking-against-openssl you might have Meta Discuss the workings and policies of this https://lists.mindrot.org/pipermail/openssh-unix-dev/2014-August/032803.html site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. undefined reference Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Why do I get “undefined reference” errors when linking against OpenSSL? up vote 4 down vote favorite 1 My compilation process throws around undefined reference to errors like ..undefined reference to `BN_cmp' although I include
[ thread ] [ subject ] [ author ] I've already filed a bug about this. https://bugzilla.mindrot.org/show_bug.cgi?id=2261 -----Original Message----- From: openssh-unix-dev [mailto:openssh-unix-dev-bounces+scott_n=xypro.com at mindrot.org] On Behalf Of vamshi reddy bairy Sent: Tuesday, August 12, 2014 12:17 PM To: openssh-unix-dev at mindrot.org Subject: openssh-6.6p1 link error to openssl Hello all, I am trying to force to link openssh to link openssl from my workaera home/xxx/openssl/lib & home/xxx/openssl/include Instead of default link "/usr/lib/" etc ./configure --with-ssl-dir=/home/xxx/install/open_ssl --with-cppflags="-I/home/xxx/install/open_ssl/include" --with-ldflags="-L/home/xxx/install/open_ssl/lib" With this I could not able to configure openssh with my built in version of openssl When I run above command I end up with "OpenSSL header version... not found" Could you please let me know where iam going wrong _______________________________________________ openssh-unix-dev mailing list openssh-unix-dev at mindrot.org https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev Previous message: openssh-6.6p1 link error to openssl Next message: openssh-6.6p1 link error to openssl Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] More information about the openssh-unix-dev mailing list