QSqlDatabase: QMYSQL driver not loaded on Xubuntu 16.04 64bits

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 12:42:35

问题


I'm trying to follow the answer given in QSqlDatabase: QMYSQL driver not loaded on Ubuntu 15.04 64bits

on Xubuntu 16.04, where:

# ls /usr/lib/x86_64-linux-gnu/libmysql* -ls
5624 -rw-r--r-- 1 root root 5757198 Abr 21 10:30 /usr/lib/x86_64-linux-gnu/libmysqlclient.a
   0 lrwxrwxrwx 1 root root      20 Abr 21 10:29 /usr/lib/x86_64-linux-gnu/libmysqlclient.so -> libmysqlclient.so.20
   0 lrwxrwxrwx 1 root root      24 Abr 21 10:29 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 -> libmysqlclient.so.20.2.1
4140 -rw-r--r-- 1 root root 4237408 Abr 21 10:30 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20.2.1

Here there are no *_r terminated files.

However, make seems to search for *_r terminated files:

/usr/bin/ld: cannot find -lmysqlclient_r
collect2: error: ld returned 1 exit status
Makefile:111: recipe for target '../../../../plugins/sqldrivers/libqsqlmysql.so' failed
make: *** [../../../../plugins/sqldrivers/libqsqlmysql.so] Error 1

From What is difference between libmysqlclient.a and libmysqlclient_r.a? it seems just a link must be made between the two. Is this the correct approach? Should I do it manually like:

cd /usr/lib/x86_64-linux-gnu/
ln -s libmysqlclient.so.20.2.1 libmysqlclient_r.so.20.2.1
ln -s libmysqlclient.so.20 libmysqlclient_r.so.20
ln -s libmysqlclient.so libmysqlclient_r.so
ln -s libmysqlclient.a libmysqlclient_r.a

Or I'm missing some thing?

来源:https://stackoverflow.com/questions/37515236/qsqldatabase-qmysql-driver-not-loaded-on-xubuntu-16-04-64bits

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!