0

我正在尝试将 mysqlclient 库添加到我的项目中。在编译期间,我收到错误:

libs/sqlapi/lib/libmysqlclient.so: undefined reference to `X509_check_ip_asc'
libs/sqlapi/lib/libmysqlclient.so: undefined reference to `X509_check_host'
collect2: error: ld returned 1 exit status

我正在使用 Debian 8 机器,我知道 X509 功能是在 OpenSSL1.0.2 中添加的,而 Debian8 仅提供 OpenSSL1.0.1。因此,我手动安装了 openssl 1.0.2s。但我不确定那里是否一切顺利。由于代码确实在我的 Linux Mint 上使用 OpenSSL 1.0.2 编译,我很确定代码本身没有任何问题。

你能给我任何建议如何缩小错误吗?

提前致谢!

4

1 回答 1

0

Ok I managed to solve the problem. Be sure that you will give the correct path of the library to the linker with the -L Flag.

So I added

-L/usr/local/ssl/lib -lssl -lcrypto

I guess I was still compiling with the old 1.0.1t version of OpenSSL before.

于 2019-07-10T09:07:08.813 回答