PDA

View Full Version : Problem deploying Qt app (plugin)



danalex07
13th February 2016, 04:13
i'm trying to deploy my app built in Qt 5.6 MSVC2015. currently i have a problem loading qsqlite.dll plugin for reading my database. i made my research and i found some ways to edit Plugin path to find the plugin in my deployed-app directory but any of them works....any helps? I've tried copying the plugin into the app folder, using qt.conf(using this method make my app no start, with other methods simply shows Driver not loaded)

anda_skoa
13th February 2016, 11:41
Maybe qsqlite.dll is missing one of its dependencies?
E.g. sqlite.dll?

Cheers,
_

danalex07
14th February 2016, 01:46
still not working. using QCoreApplication::addLibrary("plugins") in main doesn't works, using qt.conf w Plugin=plugins also not working, copying the qsqlite in plugins folder or in .exe folder or in plugins/sqldrivers also not working...any other ideas?.......i disable all Qt folders to check one by one if my app needs some extra dll but it looks like just need qsqlite.dll

the code for the connections...





#include "connection.h"
#include <QtCore>
#include <QDir>
#include <QUrl>
#include <QMessageBox>


QSqlDatabase Connection::_db=QSqlDatabase::addDatabase("QSQLITE");
Connection *Connection::_conn = new Connection;

//create connection singleton
Connection::Connection(QObject *parent) : QObject(parent){

_db.setDatabaseName(QString("%1/lib/database.sqlite").arg(QDir::currentPath()));

if(_db.open()){
qDebug()<<"database open";
}else qDebug()<<"database not open";
}

//open connection
Connection *Connection::openConn(){
if(!_conn){
_conn=new Connection();
}return _conn;
}

//close conection
Connection *Connection::closeConn(){
_db.close();
_db.removeDatabase(QSqlDatabase::defaultConnection );
return _conn;
}

QSqlDatabase Connection::db(){
return _db;
}


maybe some directive am i missing?

anda_skoa
14th February 2016, 12:05
And that folder contains both qsqlite.dll and sqlite.dll?

Cheers,
_

danalex07
14th February 2016, 18:14
yes, i put both of them next to .exe, also in /sqldrivers/, /plugins/sqldrivers/