linking to libssl and libcrypt
Shawn Protsman
protsman at mac.com
Wed Oct 8 14:27:07 PDT 2008
On Oct 8, 2008, at 1:57 PM, Bryan Blackburn wrote:
> On Wed, Oct 08, 2008 at 01:44:19PM -0700, Shawn Protsman said:
>> I'm attempting to build a static library that links to both libssl.a
>> and libcrypto.a. When I build it I get these "has no symbols"
>> messages. Any advice on resolving this? Thanks.
>>
>
> Ignore them? Some source files end up, based on #defines, to have
> nothing
> in them, so when compiled, they have no symbols. Eg, rand_os2.c:
>
> <http://cvs.openssl.org/fileview?f=openssl/crypto/rand/rand_os2.c>
>
> when built on anything other than OS/2 will have nothing, hence the
> message
> you see from libtool below. Note also at the end that it finished
> building
> the library, so does it work as expected?
Thanks for the quick reply. I copied the static lib to /usr/local/lib
and then tried to compile my binary which links to liballkeyrtv.a:
Building target: keyreq
##gcc -lallkeyrtv -o keyreq keyreq.o
gcc -o keyreq keyreq.o /usr/local/lib/liballkeyrtv.a
Undefined symbols:
"_inflateEnd", referenced from:
_zlib_stateful_free_ex_data in liballkeyrtv.a(c_zlib.o)
_bio_zlib_free in liballkeyrtv.a(c_zlib.o)
"_inflateInit_", referenced from:
_zlib_stateful_init in liballkeyrtv.a(c_zlib.o)
_bio_zlib_read in liballkeyrtv.a(c_zlib.o)
"_deflate", referenced from:
_zlib_stateful_compress_block in liballkeyrtv.a(c_zlib.o)
_bio_zlib_write in liballkeyrtv.a(c_zlib.o)
_bio_zlib_ctrl in liballkeyrtv.a(c_zlib.o)
"_deflateEnd", referenced from:
_zlib_stateful_free_ex_data in liballkeyrtv.a(c_zlib.o)
_bio_zlib_free in liballkeyrtv.a(c_zlib.o)
"_deflateInit_", referenced from:
_zlib_stateful_init in liballkeyrtv.a(c_zlib.o)
_bio_zlib_write in liballkeyrtv.a(c_zlib.o)
"_zError", referenced from:
_bio_zlib_read in liballkeyrtv.a(c_zlib.o)
_bio_zlib_write in liballkeyrtv.a(c_zlib.o)
_bio_zlib_ctrl in liballkeyrtv.a(c_zlib.o)
"_inflate", referenced from:
_zlib_stateful_expand_block in liballkeyrtv.a(c_zlib.o)
_bio_zlib_read in liballkeyrtv.a(c_zlib.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [keyreq] Error 1
More information about the macports-users
mailing list