On Tue February 28 2012, JonathonS wrote:
> Thanks :) That was the problem!  Very interesting.  I didn't think
> order mattered :)
> 

It doesn't if you use "group notation" in your ld command line.
Then ld makes multiple passes over the files mentioned in the group.

Mike
> I reordered it and it worked.
> 
> J
> 
> On Tue, Feb 28, 2012 at 5:30 PM, Wim Lewis <w...@omnigroup.com> wrote:
> >
> > On 28 Feb 2012, at 5:15 PM, JonathonS wrote:
> >> Thanks guys. Sorry for the confusion.  I thought "U" meant undefined
> >> and "T" meant it *belongs* in the text section, NOT that it actually
> >> *exists* in the text section :)
> >>
> >> Here is my linker command.
> >>
> >> g++ -g -o unit_tests unit_tests.o -L/home/user/build/openssl/debug/lib
> >> -lcrypto -lssl --L/home/user/build/libcurl/debug/lib -lcurl -ldl
> >> -lstdc++ -lpthread -lrt -lz -lstdc++
> >>
> >> When I built libcurl, I specified the --with-ssl=/.../ flag to point
> >> to my openssl build.
> >
> > Try putting -lssl after -lcurl, and -lcrypto after -lssl, on the linker 
> > command line. Unlike dynamic libraries, the linker only uses the objects 
> > from a static library that it needs in order to satisfy all the undefined 
> > symbols; and the normal behavior of 'ld' is to make one pass through its 
> > arguments, in order, pulling in whatever's needed from each one at the 
> > time. At the time it's linking things from libcrypto.a in your example it 
> > hasn't yet looked at libssl or libcurl.
> >
> >
> > ______________________________________________________________________
> > OpenSSL Project                                 http://www.openssl.org
> > User Support Mailing List                    openssl-users@openssl.org
> > Automated List Manager                           majord...@openssl.org
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    openssl-users@openssl.org
> Automated List Manager                           majord...@openssl.org
> 
> 
> 


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to