i have put all the persistence classes, in a dll.
I call them from this simple executable.
- Code: Select all
#include <QDebug>
#include <QApplication>
#include <QSqlError>
#include <QTextEdit>
#include "precompiled.h"
#include "domain/core/Use.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QFile::remove("./qxp.sqlite");
qx::QxSqlDatabase::getSingleton()->setDriverName("QSQLITE");
qx::QxSqlDatabase::getSingleton()->setDatabaseName("./qxp.sqlite");
qx::QxSqlDatabase::getSingleton()->setHostName("localhost");
qx::QxSqlDatabase::getSingleton()->setUserName("root");
qx::QxSqlDatabase::getSingleton()->setPassword("");
QSqlError daoError;
daoError = qx::dao::create_table<Use>();
use_ptr use; use.reset(new Use());
use->m_name = "This Use";
daoError = qx::dao::insert(use);
QTextEdit w;
w.setText(use->m_name);
w.show();
return a.exec();
}
}
If i comment the qx::dao functions everything works ok.
If can someone give me a hint, or a suggestion, i would really appreciate it.