Re: linking against Universal libcrypto
Re: linking against Universal libcrypto
- Subject: Re: linking against Universal libcrypto
- From: Eric Albert <email@hidden>
- Date: Tue, 17 Jan 2006 21:00:48 -0800
On Jan 17, 2006, at 11:54 AM, John C. Daub wrote:
We have a project that links against libcrypto. In the past, the way
we did
it was to just add
"-lcrypto"
to our "other linker flags" setting. And it worked just fine.
A co-worker (using Xcode 2.2) is now trying to get this project
outputting
an Intel binary, and it failed to link. He didn't tell me the exact
error,
but it was because the libcrypto that was being linked had no Intel
code in
it.
When I looked on my PPC machine running OS 10.4.4 in /usr/lib, using
"lipo
-info" on the libcrypto in there, it said it was a PPC-only binary.
When I
looked at the libcrypto within my 10.4u SDK, that's a universal binary.
We added another linker option: "-L$SDKROOT/usr/lib" and that made
things
work... we were able to link our Intel build. So it seems that before
setting -L, our -l option was looking for the libcrypto on the system
in
/usr/lib and not at the SDK. Again, this is a co-worker doing this,
so I
don't have the full build output.
Is this expected behavior? When specifying a link option like -l,
shouldn't
it honor the SDK setting and not be looking in the system?
I'd strongly discourage you from doing the "-L$SDKROOT/usr/lib" thing.
That's not supported and there's a good chance it'll cause problems for
you. SDKs aren't meant to be used piecemeal.
-lcrypto should work fine as long as your SDKROOT is set to an SDK
which exists and is universal. If it doesn't work, take a look at the
detailed build logs to see what gets passed to the linker. Hopefully
that'll show you what's going on.
Of course, you can also just add libcrypto.dylib to your project and
not pass "-lcrypto" at all....
-Eric
_______________________________________________
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