开发者

undefined BIO_new_socket function in OpenSSL library

I get the following problem with some openssl (yeah, I know it's poorly documented, but I wish to use it any way) code in a project of mine (written in c, on osx and tested in ubuntu):

Undefined symbols:

"_BIO_new_socket", referenced from: _main in cc开发者_如何学运维G3cvyw.o ld: symbol(s) not found collect2: ld returned 1 exit status

I did have SSL library problems aswel, because I forgot to link my program to the openssl libraries. The above undefined still stands though.

My compile line is:

gcc -o test_app test_app.c -lssl

Versions I use: (GCC) 4.2.1 OpenSSL 0.9.8l 5 Nov 2009

I'm fairly certain it's a (linked) library issue, as the SSL function SSL_set_bio() works (as in does not produce a build error).

Any clue is very much appreciated :)

  • Chuck


The library I was looking for was crypto. D'oh! Solution: add -lcrypto to gcc line.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜