Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt sqlite deploy exe

I have a Qt .exe built from Visual Studio 2005 (after taking the .cpp, .h, .moc, ui_ files)

I have done some simple QSqlite queries. It works fine in my development pc. But in another pc it crashes for the line below:

QSqlDatabase mSqlDb

How can I run the .exe so that it can interact with sqlite on another PC? [Other GUI application run just fine.]

What things are necessary to deploy a sqlite-qt application?

like image 548
Samir Avatar asked Mar 12 '26 12:03

Samir


2 Answers

I'd give you a better answer, but you tend to not accept answers, so here is a link to the documentation: Deploying an Application on Windows - Qt Plugins :)

like image 175
Lukáš Lalinský Avatar answered Mar 15 '26 01:03

Lukáš Lalinský


If you have Qt with shared libraries (standard compiled Qt download is Qt with shared libraries), you must follow this 2 easy steps:

1) tell QtCore to seach for plugins in 'your_directory' (use 'qApp->addLibraryPath(".")' to point into same directory, where your binary shall stay)

2) create subdirectory 'sqldrivers' in 'your_directory' and copy 'qsqlite4.dll' plugin in it (qsqlite4.dll plugin is in $$QT_DIR/plugins/sqldrivers/ directory)


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!