Qt sqlite deploy exe

I have the Qt .exe

, created from the Visual Studio 2005 (after the adoption file .cpp

, .h

, .moc

, ui_)

I've made some simple QSqlite queries. It works fine on my development machine. But on another PC it crashes on the following line:

QSqlDatabase mSqlDb

      

How do I launch .exe

it so it can interact with sqlite

on another PC? [Another GUI application works fine.]

What is required to deploy a sqlite-qt application?

+2


source to share


3 answers


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



+6


source


If you have a Qt with shared libraries (Qt's standard compiled download is Qt with shared libraries), you have to follow these two simple steps:

1) tell QtCore to connect for plugins in 'your_directory' (use 'qApp-> addLibraryPath (".")' To point to the same directory where your binary will be located)



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

+3


source


I just compiled a static version (you need to statically install it to avoid dependency problems) of a program that uses the qt sqlite library with the MinGw compiler (bundled with Qt). Here are the steps I used:

  • Open a command prompt and run c: \\ bin \ qtenv.bat
  • Go to c: \\ qt \
  • and run this: "configure -static -release -nomake demo -nomake examples -no-exceptions -qt-sql-sqlite"
  • Then run this: "mingw32-make src-sub"
  • If you get some phonon error during compilation, run "mingw32-make confclean" and then add the "-no-phonon" parameter to the command in step 3. and continue from there
  • Wait a few hours.
  • Go to your project folder
  • Run "qmake"
  • Run "mingw32-make"
  • Check your release folder, it should work

Good luck ...

+1


source







All Articles