Monday, April 11, 2011

Which Qt DLL's should I copy to make my program stand-alone?

Hi, I'm trying to make a distribution directory with my application. I've copied several Qt DLLs to that directory, and the program seems to be working, with one exception: it doesn't seem to find SQL plugin for SQLite. Copying qtsqlite.dll to the directory, doesn't allow my application to open or create SQLite files. What must be the direcotry structure or which additional files need to be copied so that the program can read the database?

From stackoverflow
  • Most probably, the qtsqlite.dll itself depends on original SQLite DLL's which you probably need to copy as well.

    Don't forget to include an LGP license copy in your distribution as well as pointers to the original download ressources of the libs you include and their sources. To stay with the law :-)

  • you can use depends.exe to see exactly what the dependencies of your exe are and make sure they're all included.

    Also, read this page about qt plugins. they are supposed to be in a specific directory called "plugins" and not in the main directory with all the other dlls.

    dwj : By default the application will use its start-up directory as the plugins directory; you need to put the drivers in a base class directory name: e.g., app_dir/sqldrivers.
  • Thanks to the link @shoosh provided, I was able to fix the problem. I needed to create sqldrivers subdirectory in the distribution dir with qsqlite.dll library inside. But that was just step one. Do you have any tips and resources on creating a full-blown Windows installer? I'm mainly a Linux programmer so this area is unknown to me.

    ypnos : Perhaps NSIS is a good starting point for you: http://nsis.sourceforge.net/ It is open source and scriptable. Good for Linux programmers :-D

0 comments:

Post a Comment