Re: Linking to libcrypto
Re: Linking to libcrypto
- Subject: Re: Linking to libcrypto
- From: Kyle Moffett <email@hidden>
- Date: Sun, 2 Nov 2003 21:07:11 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Nov 02, 2003, at 18:52, Michael Rothwell wrote:
I need to use some MD5 functions in my application. I am linking
against libcrypto for the MD5 functions. When I build on Panther, it
runs on Panther fine. When I build with the "development" settings, it
also runs on Jaguar, so long as I've copied libcrypto to my project
folder and run it through "install_name_tool -id @executable_path
...". If I don't copy and frob libcrypto, my application tries to link
against /usr/lib/libcrypto.0.9.7.dylib. this is contrary to behavior
I've seen on any other Unix. It should be linking against the generic
version of the library -- the symlink with a less specific version in
its filename -- rather than the exact version on the current OS. When
I copy the application to a Jaguar box for testing, it fails, looking
for /usr/lib/libcrypto.0.9.7.dylib, rather than finding
/usr/lib/libcrypto.0.9.dylib (or better yet,
/usr/lib/libcrypto.dylib). The install_name_tool trick doesn't work,
either. My expectation is that both will link to
/usr/lib/libcrypto.dylib. Or failing that, use the version in the
Frameworks directory of the application. Having to copy a system
library into the application's local libraries seems like an awful
hack, anyway.
How does one get linking to actually work on OSX such that
applications are portable between versions?
Panther includes version 0.9.7 of openssl (Which includes libcrypto),
whereas Jaguar included 0.9.6. Unfortunately, the two are binary
incompatible (IIRC, it was also source incompatible). I recommend that
you build your own version with whatever settings you need and drop it
in your application bundle. OpenSSL 0.9.7 included a number of
bugfixes, so I recommend that you use that version. Unfortunately,
there is no easy way to handle library issues like this. Make sure to
stick a notice somewhere in your readmes and program indicating that
you are using OpenSSL (As per www.openssl.org)
Cheers,
Kyle Moffett
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)
iD8DBQE/pbhQag7LSGnFq10RAhR+AJ9C0JOGZ+lgmqNe+ZuEDY5y0ozUHQCfU9Tu
Upxnn2LfbPKsbCC2X8etlgs=
=ilsK
-----END PGP SIGNATURE-----
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.