Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hiddenpremise

macrumors regular
Original poster
[edit]PROBLEM SOLVED - thanks chown33[/edit]
I am trying to write a foundation tool using openssl's rc4 cryptography.
I have included libssl.0.9.8.dylib in the project and use a
Code:
#include <openssl/rc4.h>
to call the header file that I need. However whenever I try to build, I get an error
Code:
Undefined symbols:
  "_RC4_set_key", referenced from:
      _main in sslrc4.o
  "_RC4", referenced from:
      _main in sslrc4.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
. What am I missing, to get use of these functions?

Thanks,
W
 
You need an additional library. Here's how to find it.

Enter these Terminal commands:
Code:
nm /usr/lib/* >rc4.txt 2>&1
open rc4.txt

When rc4.txt is open in an editor, find RC4_set_key. Click Find Next until a line like the red-hilited one appears:
Code:
[COLOR="Green"]/usr/lib/libcrypto.dylib[/COLOR](rc4_skey.o):
919b9414 T _RC4_options
[COLOR="Red"]919b9424 T _RC4_set_key[/COLOR]
a1951420 D _RC4_version
The 'T' line identifies where the symbol is defined. The name of the lib where it occurs is shown above it (hilited here in green).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.