The debug version of my project runs perfectly and the release version also runs except for the sqlite code. I get the following error messages: "QSqlDatabase: QSQLITE driver not loaded. QSqlDatabase: available drivers: QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins." This happens only when I try to open the db.
In my code I am not not connecting to a db on disk or as a resource file. I simply want an open and empty sqlite database in which I will build tables and populate them programmatically. So my db is the default and nameless db which sqlite creates if you don't provide a name. I have included qsqlite.dll, sqlite.dll, Qt6Core.dll, Qt6Sql.dll, sqlite3.dll, sqlite3.def but all to no avail. I have inserted them into the same directory ("release") as the executable and also in an "sqldrivers" subdirectory. No change occurred.
The required plugins can be found in Qt(root)\version\compiler_name\plugins. So in my case the location is: C:\Users\Owner\Development\Qt\6.5.2\mingw_64\plugins\dir where "dir" can be "sqldrivers", "styles", "platforms" ...etc. Directory structures (in "release") must be preserved.