Hi folks
I'm a bit desperate here, I rebuild QT 4.7.2 with VS2008 with the following parameters:
configure -no-qt3support -platform win32-msvc2008 -qt-sql-mysql -plugin-sql-mysql -I C:\MySQL\include -L C:\MySQLßlib -l libmysql
This compiles and buils just fine with nmake.
The I try to build my code with the folloing .pro file:
#! [0]
TEMPLATE = app
LANGUAGE = C++
CONFIG += console
QT += sql
QTPLUGIN += qsqlmysql
HEADERS = mainwindow.h \
csv.h
# myobject.h
SOURCES = main.cpp \
mainwindow.cpp \
csv.cpp
FORMS = ADBI.ui
#! [0]
#! [0]
TEMPLATE = app
LANGUAGE = C++
CONFIG += console
QT += sql
QTPLUGIN += qsqlmysql
HEADERS = mainwindow.h \
csv.h
# myobject.h
SOURCES = main.cpp \
mainwindow.cpp \
csv.cpp
FORMS = ADBI.ui
#! [0]
To copy to clipboard, switch view to plain text mode
My simple test code looks like this:
#include <QtCore>
#include <QApplication>
#include <QtSql>
#include <QSqlDatabase>
#include <QtPlugin>
#include "mainwindow.h"
Q_IMPORT_PLUGIN(qsqlmysql)
int main(int argc, char **argv)
{
//QMainWindow *MW = new MainWindow();
//qDebug() << QSqlDatabase::drivers();
//MW->show();
return app.exec();
}
#include <QtCore>
#include <QApplication>
#include <QtSql>
#include <QSqlDatabase>
#include <QtPlugin>
#include "mainwindow.h"
Q_IMPORT_PLUGIN(qsqlmysql)
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
//QMainWindow *MW = new MainWindow();
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
qDebug() << QApplication::libraryPaths();
//qDebug() << QSqlDatabase::drivers();
//MW->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
I now get the following linker error:
1>main.obj : error LNK2019:can't find external Symbol ""class QObject * __cdecl qt_plugin_instance_qsqlmysql(void)" (?qt_plugin_instance_qsqlmysql@@YAPAVQObject@@XZ)" in Funktion ""public: __thiscall StaticqsqlmysqlPluginInstance::StaticqsqlmysqlPlug inInstance(void)" (??0StaticqsqlmysqlPluginInstance@@QAE@XZ)".
If I comment out: Q_IMPORT_PLUGIN(qsqlmysql)
it links just fine but then I get: DRIVER NOT LOADED.
Any advice is very appreciated!
Bookmarks