PDA

View Full Version : Using sql with jambi



bender86
26th December 2007, 12:04
Hi, I'm trying to get sql work in Jambi.
I use two drivers: QSQLITE and QMYSQL. Both are compiled in Qt library NOT as plugins (config command line: ... -qt-sql-sqlite -qt-sql-mysql ...), and both works in C++ applications.
The problem is: when I call QSqlDatabase.addDatabase("QSQLITE") or "QMYSQL" in Jambi I get an error message "Cannot mix incompatible Qt libraries" and application exits. Even this minimal application cause that error:

public static void main(String[] args) {
QApplication.initialize(args);
QSqlDatabase db = QSqlDatabase.addDatabase("QSQLITE");
QApplication.exec();
}
The crash is caused by native method QSqlDatabase.addDatabase(String driverName, String connectionName).

I'll be grateful for any help.



EDIT
Mh... It seems that sql plugins DO NOT work in C++ applications. I'll try to recompile Qt.



SOLVED
There were two copies of QtCore4.dll and QtGui4.dll in another %PATH% directory. Deleted them, now applications (Java and C++) works.