LINUX.ORG.RU

QT & Mysql


0

0

ПРивет всем вопрос еще актуален. При написании приложения на QT для конекта к базе mysql возникает следующая ошибка. При запуске программы в консоле пишет: Driver not load QMYSQL3,Available drivers: Почему он не видит драйверов mysql, патек qt-mysql поставил с библиотекой. ОС Debian Sarge, все пакеты стандартные

anonymous

Только вчера с подобной проблемой сталкивался.
Вот решение:

How to build the plugin on Unix/Linux 

You need the MySQL header files and as well as the shared library libmysqlclient.so. Depending on your Linux distribution you need to install a package which is usually called "mysql-devel". 

Tell qmake where to find the MySQL header files and shared libraries (here it is assumed that MySQL is installed in /usr/local) and run make: 

cd $QTDIR/plugins/src/sqldrivers/mysql
qmake -o Makefile "INCLUDEPATH+=/usr/local/include" "LIBS+=-L/usr/local/lib -lmysqlclient" mysql.pro
make



Более подробно читай здесь http://doc.trolltech.com/3.3/sql-driver.html#QMYSQL3

Для Qt != 3.3 изменения в ссылке тривиальны :)

Krivenok_Dmitry
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.