【发布时间】:2017-05-17 16:32:51
【问题描述】:
不知什么原因,我的 libmysqlclient.a 在我的 CentOS 7 中消失了。 然后我的程序出现链接器错误,说找不到 libmysqlclient。
然后我发现我的 mysql-devel 包不见了:
yum info mysql-devel
yum install mysql-devel
回复如下:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: repo.virtualhosting.hk
* epel: mirror.pregi.net
* extras: repo.virtualhosting.hk
* updates: repo.virtualhosting.hk
Package MariaDB-devel-10.2.5-1.el7.centos.x86_64 already installed and latest version
所以我想也许我应该改用 libmariadbclient,但是当我将我的程序与 libmariadbclient 链接时,它出现了链接错误:
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x191): undefined reference to `CRYPTO_num_locks'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x1aa): undefined reference to `CRYPTO_THREADID_set_callback'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x1b6): undefined reference to `CRYPTO_set_locking_callback'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x1bb): undefined reference to `SSL_library_init'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x1c7): undefined reference to `SSL_load_error_strings'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x1cc): undefined reference to `OPENSSL_add_all_algorithms_noconf'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x2b4): undefined reference to `CRYPTO_set_locking_callback'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x2bb): undefined reference to `CRYPTO_set_id_callback'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x2df): undefined reference to `CRYPTO_num_locks'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x340): undefined reference to `EVP_cleanup'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x345): undefined reference to `CRYPTO_cleanup_all_ex_data'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x34a): undefined reference to `ERR_free_strings'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x351): undefined reference to `CONF_modules_free'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_init':
(.text+0x3e1): undefined reference to `SSLv23_client_method'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `my_cb_threadid':
(.text+0x1e): undefined reference to `CRYPTO_THREADID_set_numeric'
/usr/lib64//libmariadbclient.a(ma_compress.c.o): In function `_mariadb_compress_alloc':
(.text+0x5d): undefined reference to `compress'
/usr/lib64//libmariadbclient.a(ma_compress.c.o): In function `_mariadb_uncompress':
(.text+0x191): undefined reference to `uncompress'
collect2: error: ld returned 1 exit status
我一直在使用 libmysqlclient 连接我的 MariaDB 10.1,最近一直在尝试从源代码构建它,但由于 OpenSSL 1.1 版本的问题而失败。在这里你可以看到我的另一篇文章:
Error "incomplete type MD5_CONTEXT" with MariaDB 10.2 and Openssl 1.1.0e
所以我很困惑为什么 mysqlclient.a 消失了,我应该使用哪个库。
谁能帮忙?
谢谢!
【问题讨论】:
标签: mariadb