QMYSQL Driver (undefined symbol: mysql_server_init)
Hello,
I have problem with app with mysql.
When I run app with mysql I get:
Code:
symbol lookup error: /usr/local/Trolltech/QtEmbedded-4.6.2-arm/plugins/sqldrivers/libqsqlmysql.so: undefined symbol: mysql_server_init
I run app on ARM-board with mysql ver. 14.14 distrib 5.1.40, for angstrom-linux-gnueabi (arm) using EditLine wrapper.
I built database drivers using:
Code:
qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib/mysqlclient_r" mysql.pro
make
on Ubuntu without errors.
I don't know where is error.. Could you help me?
thanks,
Przemek
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
Try to recompile the driver using:
Code:
qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib -lmysqlclient_r" mysql.pro
make
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
Quote:
Originally Posted by
saa7_go
Try to recompile the driver using:
Code:
qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib -lmysqlclient_r" mysql.pro
make
in result I get:
Code:
cannot find -lmysqlclient_r"
:(
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
Is there any libmysql*.a in /usr/lib?
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
yes, in /usr/lib I have:
Code:
-rw-r--r-- 1 root root 2819966 2010-06-07 21:58 libmysqlclient.a
-rw-r--r-- 1 root root 1068 2010-06-07 21:57 libmysqlclient.la
-rw-r--r-- 1 root root 2834652 2010-06-07 21:58 libmysqlclient_r.a
-rw-r--r-- 1 root root 1122 2010-06-07 21:57 libmysqlclient_r.la
lrwxrwxrwx 1 root root 22 2010-07-08 16:31 libmysqlclient_r.so -> libmysqlclient_r.so.16
lrwxrwxrwx 1 root root 26 2010-07-08 16:31 libmysqlclient_r.so.16 -> libmysqlclient_r.so.16.0.0
-rw-r--r-- 1 root root 2047772 2010-06-07 21:58 libmysqlclient_r.so.16.0.0
lrwxrwxrwx 1 root root 20 2010-07-08 16:31 libmysqlclient.so -> libmysqlclient.so.16
lrwxrwxrwx 1 root root 24 2010-07-08 16:31 libmysqlclient.so.16 -> libmysqlclient.so.16.0.0
-rw-r--r-- 1 root root 2039580 2010-06-07 21:58 libmysqlclient.so.16.0.0
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
Quote:
Originally Posted by
przemek
When I run app with mysql I get:
Code:
symbol lookup error: /usr/local/Trolltech/QtEmbedded-4.6.2-arm/plugins/sqldrivers/libqsqlmysql.so: undefined symbol: mysql_server_init
I think you successfully build qmysql driver. How did you build it?
3 Attachment(s)
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
My *cpp, *pro files and Makefile in attachments.
Do you think, that it could be problem with my linux on arm, or ubuntu, qt, or etc.?
I haven't got any idea how to solve my problem.
Maybe I should recompile all qt?
edit:
I recompile plugin on other computer and copy libqsqlmysql.so to arm-board and now I have message:
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
Quote:
Originally Posted by
przemek
My *cpp, *pro files and Makefile in attachments.
Do you think, that it could be problem with my linux on arm, or ubuntu, qt, or etc.?
I haven't got any idea how to solve my problem.
Maybe I should recompile all qt?
edit:
I recompile plugin on other computer and copy libqsqlmysql.so to arm-board and now I have message:
I don't know. BTW, Do you use mysql from your host operating system(ubuntu) or angstrom?
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
Touday I tray to resolve this QMSQL
But no chance with qmake
I recive next message qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib -lmysqlclient_r" mysql.pro
Error processing project file: /usr/lib/qt4/plugins/sqldrivers/mysql/mysql.pro
and QT will not make application witout this mysql driver
I have ubuntu and QT4
Can somebody help
Please
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
Quote:
Originally Posted by
miroslavgojic
Touday I tray to resolve this QMSQL
But no chance with qmake
I recive next message qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib -lmysqlclient_r" mysql.pro
Error processing project file: /usr/lib/qt4/plugins/sqldrivers/mysql/mysql.pro
and QT will not make application witout this mysql driver
I have ubuntu and QT4
Can somebody help
Please
Do you run qmake as root or using sudo?
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
I use
for entering as root
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
Maybe, there is a problem with your mysql.pro. Can you attach it here?
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
I don't have mysql.pro
that file is not available on my Ubuntu,
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
What i mean is this /usr/lib/qt4/plugins/sqldrivers/mysql/mysql.pro. If mysql.pro doesn't exist, i assume you install Qt from your package management. Maybe you can search Qt MySQL plugin package using synaptic or something like that.
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
yes, I was install Qt from synaptic install manager
I install all package but mysql.pro is not present
and I have qt4 and qt3, can this make problems
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
Quote:
Originally Posted by
miroslavgojic
I install all package but mysql.pro is not present.
and I have qt4 and qt3, can this make problems.
I'm not sure. But, have you search Qt4 MySQL plugin using synaptic?
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
I have look in synaptic and I have Qt mysql driver, it is installed at my Ubuntu
Qt4 Mysql database driver - this is name of synaptic package
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
So, you don't need to rebuilt Qt MySQL driver. Try to create simple application using MySQL driver.
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
I try to create simply application Qt and Mysql
and there I find some unexpected problems.
I make one project on C not C++, and it work, but this is not from QT, simply C code from gedit and gcc
I have one project in QT
one file is
connector.h
Code:
#ifndef CONNECTOR_H
#define CONNECTOR_H
#include <QSqlDatabase>
#include <QMessageBox>
bool createConnection()
{
{
db.setHostName("localhost");
db.setDatabaseName("test");
db.setUserName("user");
db.setPassword("pass");
if (!db.open())
{
m.setText("Greska I");
m.exec();
return false;
}
else
{
return true;
}
}
else
{
m.setText("Nema drajver za DB");
m.exec();
return false;
}
}
#endif // CONNECTOR_H
and main.cpp
Code:
#include <QtGui/QApplication>
#include "mainwindow.h"
#include "connector.h"
int main(int argc, char *argv[])
{
if(!createConnection())
return 1;
MainWindow w;
w.show();
return a.exec();
}
and this project not work at QT
Re: QMYSQL Driver (undefined symbol: mysql_server_init)
Are there any error/warning messages from your application?