Não é possível compilar o plugin mysql Qt 5.6.0 no Ubuntu 16.04 LTS - 64bit

3

Eu atualizei recentemente o Qt para a versão 5.6.0 e minha Ubuntu estação de trabalho para a versão 16.04 LTS . Agora, eu sei que tenho que recompilar mysql plugin e consegui fazer isso várias vezes. No entanto, eu tinha atualização de problemas mysql server ao atualizar Ubuntu 14.04 LTS para Ubuntu 16.04 LTS e resolvi com fazer backup de bancos de dados e remover e reinstalar mysql server 5.7 de Ubuntu 16.04 LTS repositories, mysql server now funciona bem. Então eu tentei recompilar qt mysql plugin com:

user@work002:/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/src/plugins/sqldrivers/mysql$ clear && make clean && /opt/Qt/opensource/64bit/5.5/5.6/gcc_64/bin/qmake "INCLUDEPATH+=/usr/local/include" "LIBS+=-Lusr/local/lib -lmysqlclient_r" mysql.pro && make all && make install

de Como construir o plugin QMYSQL na documentação oficial do Unix e OS X e Eu recebo seguindo linker error :

rm -f .moc/moc_qsql_mysql_p.cpp
rm -f .moc/main.moc .moc/qsql_mysql.moc
rm -f .obj/main.o .obj/qsql_mysql.o .obj/moc_qsql_mysql_p.o
rm -f *~ core *.core
/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/bin/moc -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/mkspecs/linux-g++ -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/src/plugins/sqldrivers/mysql -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore main.cpp -o .moc/main.moc
g++ -c -pipe -I/usr/include/mysql -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore -I.moc -I../../../../mkspecs/linux-g++ -o .obj/main.o main.cpp
/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/bin/moc -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/mkspecs/linux-g++ -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/src/plugins/sqldrivers/mysql -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore ../../../sql/drivers/mysql/qsql_mysql.cpp -o .moc/qsql_mysql.moc
g++ -c -pipe -I/usr/include/mysql -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore -I.moc -I../../../../mkspecs/linux-g++ -o .obj/qsql_mysql.o ../../../sql/drivers/mysql/qsql_mysql.cpp
/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/bin/moc -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/mkspecs/linux-g++ -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/src/plugins/sqldrivers/mysql -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore ../../../sql/drivers/mysql/qsql_mysql_p.h -o .moc/moc_qsql_mysql_p.cpp
g++ -c -pipe -I/usr/include/mysql -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore -I.moc -I../../../../mkspecs/linux-g++ -o .obj/moc_qsql_mysql_p.o .moc/moc_qsql_mysql_p.cpp
rm -f libqsqlmysql.so
g++ -Wl,--no-undefined -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,$ORIGIN -Wl,-rpath,$ORIGIN -Wl,-rpath,$ORIGIN/../../lib -shared -o libqsqlmysql.so .obj/main.o .obj/qsql_mysql.o .obj/moc_qsql_mysql_p.o  -L/usr/local/lib -rdynamic -L/usr/lib64/mysql -lmysqlclient_r -lz -lcrypt -lnsl -lm -lssl -lcrypto -L/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/lib -lQt5Sql -lQt5Core -lpthread  
/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

Aqui está também uma lista de mysql pacotes relacionados , recuperados com sudo dpkg -l|grep mysql :

ii  libmysqlclient-dev                            5.7.12-0ubuntu1                                     amd64        MySQL database development files
rc  libmysqlclient18:amd64                        5.5.49-0ubuntu0.14.04.1                             amd64        MySQL database client library
ii  libmysqlclient20:amd64                        5.7.12-0ubuntu1                                     amd64        MySQL database client library
ii  libmysqlclient20:i386                         5.7.12-0ubuntu1                                     i386         MySQL database client library
rc  libmysqlcppconn7                              1.1.3-5                                             amd64        MySQL Connector for C++ (library)
ii  libqt4-sql-mysql:i386                         4:4.8.7+dfsg-5ubuntu2                               i386         Qt 4 MySQL database driver
ii  mysql-client-5.7                              5.7.12-0ubuntu1                                     amd64        MySQL database client binaries
ii  mysql-client-core-5.7                         5.7.12-0ubuntu1                                     amd64        MySQL database core client binaries
ii  mysql-common                                  5.7.12-0ubuntu1                                     all          MySQL database common files, e.g. /etc/mysql/my.cnf
ii  mysql-server                                  5.7.12-0ubuntu1                                     all          MySQL database server (metapackage depending on the latest version)
ii  mysql-server-5.7                              5.7.12-0ubuntu1                                     amd64        MySQL database server binaries and system database setup
ii  mysql-server-core-5.7                         5.7.12-0ubuntu1                                     amd64        MySQL database server binaries
rc  mysql-utilities                               1.6.1-2                                             all          collection of scripts for managing MySQL servers
rc  mysql-workbench-community                     6.3.6-1ubu1404                                      amd64        MySQL Workbench
ii  php-mysql                                     1:7.0+35ubuntu6                                     all          MySQL module for PHP [default]
rc  php5-mysql                                    5.5.9+dfsg-1ubuntu4.16                              amd64        MySQL module for php5
rc  php5-mysqlnd                                  5.5.9+dfsg-1ubuntu4.14                              amd64        MySQL module for php5 (Native Driver)
ii  php7.0-mysql                                  7.0.4-7ubuntu2                                      amd64        MySQL module for PHP

De acordo com comentário de adonis do usuário , alterei compilation command para

user@work002:/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/src/plugins/sqldrivers/mysql$ make clean && /opt/Qt/opensource/64bit/5.5/5.6/gcc_64/bin/qmake "INCLUDEPATH+=/usr/local/include" "LIBS+=-L/usr/local/lib -llibmysqlclient" mysql.pro && make all && make install

e recebo os seguintes erros:

rm -f .moc/moc_qsql_mysql_p.cpp
rm -f .moc/main.moc .moc/qsql_mysql.moc
rm -f .obj/main.o .obj/qsql_mysql.o .obj/moc_qsql_mysql_p.o
rm -f *~ core *.core
/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/bin/moc -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/mkspecs/linux-g++ -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/src/plugins/sqldrivers/mysql -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore main.cpp -o .moc/main.moc
g++ -c -pipe -I/usr/include/mysql -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore -I.moc -I../../../../mkspecs/linux-g++ -o .obj/main.o main.cpp
/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/bin/moc -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/mkspecs/linux-g++ -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/src/plugins/sqldrivers/mysql -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore ../../../sql/drivers/mysql/qsql_mysql.cpp -o .moc/qsql_mysql.moc
g++ -c -pipe -I/usr/include/mysql -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore -I.moc -I../../../../mkspecs/linux-g++ -o .obj/qsql_mysql.o ../../../sql/drivers/mysql/qsql_mysql.cpp
/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/bin/moc -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/mkspecs/linux-g++ -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/src/plugins/sqldrivers/mysql -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore ../../../sql/drivers/mysql/qsql_mysql_p.h -o .moc/moc_qsql_mysql_p.cpp
g++ -c -pipe -I/usr/include/mysql -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore -I.moc -I../../../../mkspecs/linux-g++ -o .obj/moc_qsql_mysql_p.o .moc/moc_qsql_mysql_p.cpp
rm -f libqsqlmysql.so
g++ -Wl,--no-undefined -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,$ORIGIN -Wl,-rpath,$ORIGIN -Wl,-rpath,$ORIGIN/../../lib -shared -o libqsqlmysql.so .obj/main.o .obj/qsql_mysql.o .obj/moc_qsql_mysql_p.o  -L/usr/local/lib -llibmysqlclient -rdynamic -L/usr/lib64/mysql -lmysqlclient_r -lz -lcrypt -lnsl -lm -lssl -lcrypto -L/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/lib -lQt5Sql -lQt5Core -lpthread  
/usr/bin/ld: cannot find -llibmysqlclient
/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

Segundo conselho do usuário adonis ,

clear && make clean && /opt/Qt/opensource/64bit/5.5/5.6/gcc_64/bin/qmake "INCLUDEPATH+=/usr/local/include" "LIBS+=-Lusr/local/lib -lmysqlclient" mysql.pro && make all && make install ,

ainda dá erro:

rm -f .moc/moc_qsql_mysql_p.cpp
rm -f .moc/main.moc .moc/qsql_mysql.moc
rm -f .obj/main.o .obj/qsql_mysql.o .obj/moc_qsql_mysql_p.o
rm -f *~ core *.core
/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/bin/moc -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/mkspecs/linux-g++ -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/src/plugins/sqldrivers/mysql -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore main.cpp -o .moc/main.moc
g++ -c -pipe -I/usr/include/mysql -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore -I.moc -I../../../../mkspecs/linux-g++ -o .obj/main.o main.cpp
/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/bin/moc -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/mkspecs/linux-g++ -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/src/plugins/sqldrivers/mysql -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore ../../../sql/drivers/mysql/qsql_mysql.cpp -o .moc/qsql_mysql.moc
g++ -c -pipe -I/usr/include/mysql -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore -I.moc -I../../../../mkspecs/linux-g++ -o .obj/qsql_mysql.o ../../../sql/drivers/mysql/qsql_mysql.cpp
/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/bin/moc -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/mkspecs/linux-g++ -I/opt/Qt/opensource/64bit/5.5/5.6/Src/qtbase/src/plugins/sqldrivers/mysql -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore ../../../sql/drivers/mysql/qsql_mysql_p.h -o .moc/moc_qsql_mysql_p.cpp
g++ -c -pipe -I/usr/include/mysql -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I/usr/local/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql/5.6.0/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0 -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore/5.6.0/QtCore -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtSql -I/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/include/QtCore -I.moc -I../../../../mkspecs/linux-g++ -o .obj/moc_qsql_mysql_p.o .moc/moc_qsql_mysql_p.cpp
rm -f libqsqlmysql.so
g++ -Wl,--no-undefined -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,$ORIGIN -Wl,-rpath,$ORIGIN -Wl,-rpath,$ORIGIN/../../lib -shared -o libqsqlmysql.so .obj/main.o .obj/qsql_mysql.o .obj/moc_qsql_mysql_p.o  -Lusr/local/lib -lmysqlclient -rdynamic -L/usr/lib64/mysql -lmysqlclient_r -lz -lcrypt -lnsl -lm -lssl -lcrypto -L/opt/Qt/opensource/64bit/5.5/5.6/gcc_64/lib -lQt5Sql -lQt5Core -lpthread  
/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

Deve ser algum erro estúpido, mas eu simplesmente não consigo encontrá-lo, por que eu recebo esse erro, estou perdendo algum pacote, talvez?

    
por KernelPanic 13.05.2016 / 23:10

2 respostas

7

libmysqlclient_r.so não faz parte do libmysqlclient no Ubuntu 16.04. Você pode criar um link simbólico para o libmysqlclient.so compatível antes de executar seu comando usando:

sudo ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so /usr/lib/x86_64-linux-gnu/libmysqlclient_r.so
    
por user448115 14.05.2016 / 13:07
0

No Kubuntu 16.04

cp /opt/Qt/5.5/gcc/plugins/sqldrivers/libqsqlmysql.so /opt/Qt/5.5/gcc/plugins/sqldrivers/libqsqlmysql.so.ori
cp /usr/lib/i386-linux-gnu/qt5/plugins/sqldrivers/libqsqlmysql.so  /opt/Qt/5.5/gcc/plugins/sqldrivers/libqsqlmysql.so
    
por rosid 15.09.2017 / 16:39