I still got the problem not finding the sql libs from the plugin directory. I tried tracing the plugin and library paths with following results:
plugin path: C:\QtSDK\Desktop\Qt\4.8.0\mingw\plugins
lib paths: C:/Program Files (x86)/App/plugins, C:/QtSDK/Desktop/Qt/4.8.0/mingw/plugins, C:/Program Files (x86)/App
So it seems that the application folder ("App") is listed in lib paths as well as the plugins path. For some reason that is not enough and the actual plugin path refers to a folder in the develop-PC. How can I get the sql plugins work somewhere under the application path?
It seems to find all the drivers and I'm able to trace them:
QSQLITE, QODBC3, QODBC, QPSQL7, QPSQL
but when trying to open a DB it gives error: Driver not loaded
Edit.
In addition it does not make it easier that dependency walker always jams if the App is profiled from installation directory - it only works when profiled from "release" directory.
FINAL EDIT - SOLVED
I added plugins path as follows and got it working:
int main(int argc, char *argv[])
{
MainWindow w;
w.show();
return a.exec();
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.addLibraryPath(QCoreApplication::applicationDirPath()+"/plugins");
MainWindow w;
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Also my problem with SQL driver was that I initialized it in global are, which was wrong. See thread: http://www.qtcentre.org/threads/4392...ot-loaded-quot
Bookmarks