Adding QODBC support on ubuntu.
Hello, ODBC is not build in the Ubuntu/Debian packages and there are no .debs available for it. I reported a bug here:
https://bugs.launchpad.net/ubuntu/+s...11/+bug/179261
Now i'm trying to get the plugin to work.
I followed this instruction to build a QODBC plugin called 'libqsqlodbc.so'. Only difference is that the plugin is built with qt-x11-opensource-src-4.3.3 and Ubuntu installs 4.3.2.
I can load the driver dynamicly using QSqlDriverPlugin and QSqlDatabase::addDatabase(driver, "QODBC" ).
But is this the only thing you can do with a plugin? Load it dynamically from code? Or is it possoble Qt will load the plugin itself when it needs it without loading it from code.
I tried just putting it in /usr/share/qt4/plugins/sqldrivers/ but its not automatically seen then.:eek:
I'm a bit confused about it.
Re: Adding QODBC support on ubuntu.
Quote:
Originally Posted by
Peter_V
I tried just putting it in /usr/share/qt4/plugins/sqldrivers/ but its not automatically seen then.
Qt won't load a plugin built for a newer version.
Re: Adding QODBC support on ubuntu.
Well I found the correct version qt-x11-opensource-src-4.3.2.tar.gz, compiled the odbc driver and added it to '/usr/share/qt4/plugins/sqldrivers/', but its still not seen.
A test program sais:
QSqlDatabase: QODBC driver not loaded
QSqlDatabase: available drivers: QPSQL7 QPSQL QMYSQL3 QMYSQL QSQLITE QSQLITE2
test program is just one line:
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC" );
Re: Adding QODBC support on ubuntu.
Quote:
Originally Posted by
Peter_V
test program is just one line:
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC" );
You have to create QApplication or QCoreApplication instance before you can use any plugins.
Re: Adding QODBC support on ubuntu.
Quote:
Originally Posted by
jacek
You have to create QApplication or QCoreApplication instance before you can use any plugins.
Thanks a lot, that worked :D