Re: Linking to libcrypto for 10.2 & 10.3
Re: Linking to libcrypto for 10.2 & 10.3
- Subject: Re: Linking to libcrypto for 10.2 & 10.3
- From: Heath Raftery <email@hidden>
- Date: Wed, 05 Jan 2005 18:36:47 +1100
On 05/01/2005, at 9:21 AM, Glen Simmons wrote:
On 4 Jan, 2005, at 3:44 PM, Finlay Dobbie wrote:
On Tue, 4 Jan 2005 15:31:18 -0600, Glen Simmons
<email@hidden> wrote:
To try to work around this, I downloaded the OpenSSL source and
compiled libcrypto.a. I added this to my project and removed
libcrypto.dylib. But, otool -L shows that my built application still
tries to use libcrypto.0.9.7.dylib, so it still won't launch on 10.2.
Why is it trying to link to the dylib when I don't have it included
in
my project???
Because the linker is weird and Xcode doesn't know how to work around
it properly. File the relevant bugs.
It might work if you use the -search_paths_first linker flag (see the
ld(1) manual page for more details).
Would I put that in Other Linker Flags? Tried that and got
g++-3.3: unrecognized option `-search_paths_first'
That looks like it was passed as a compiler flag, not a linker flag. To
pass a linker flag to the compiler (again, from the man page) you could
try:
-Xlinker -search_paths_first
It's still a lucky dip with that option, which still relies on the
static library being found before the dynamic library by the linker.
You might need to put your static library in a certain directory (say
/usr/local/lib or something) away from the dynamic library, and then
specifying that directory in such a way that it is searched before the
directory with the dynamic library. Yeah, it's a hassle, and takes a
bit of reading of man ld and man gcc to get your head around.
You could even get really hacky, and hide the dynamic library while
compiling. Horrible option that, because it requires moving the file
twice (once to hide and once to restory) every compile, and will break
any apps dynamically linked to the library on the way. But it might
work.
Heath
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden