Home  
Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
75 user(s) are online (67 user(s) are browsing Forums)

Members: 1
Guests: 74

RIBDEVIL, more...
Support us!
Recent OS4 Files
OS4Depot.net



(1) 2 »


QSqlDatabase: QSQLITE driver not loaded
Quite a regular
Joined:
2013/10/17 15:21
From Hungary
Posts: 534
I have the SQLite plugin in qt:plugins/sqldrivers, but according to the error message I don't have any drivers available:
Quote:
QSqlDatabase: QSQLITE driver not loaded
QSqlDatabase: available drivers:

I tried adding the path manually using many variations, but neither of these helped:
QApplication::addLibraryPath("/qt/plugins/sqldrivers/");
QApplication::addLibraryPath("/qt/plugins/sqldrivers");
QApplication::addLibraryPath("qt:plugins/sqldrivers/");
QApplication::addLibraryPath("qt:plugins/sqldrivers");

Does anyone know how to get the SQLite Qt plugin to work?

_________________
I see the jimmies have been rustled.
   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Just can't stay away
Joined:
2009/10/7 0:11
From Copenhagen
Posts: 1186
@BSzili

Well, step1 is to check, that the the file libqsqlite.so is in qt:plugins/slqplugins. If not, find it in one of the release archives. step2 is to check, if your qt: assign is set up correctly. It should point to the root of your qt installation. step3 is to check, if you have libsqlite3.so in your Sys:SObjs/ folder, and that it is the correct version. I think there are at this point quite a lot of different versions of that one floating around, and not every one of them will work with qt. I think I included one version in the Qt installation, that should work no matter what. Get that one and throw it in Sys:SObjs/ (while renaming any other existing version that might lye there). The version I am using is datestamped 22nd of March 2010.

EDIT: And for precisely that reason it is important to check out (just run, once) one of the sql examples from the Qt package to see, if the problem is somehow specifically Brewtarget or a general Qt setup issue on your system. Do you have OS4.1 Final installed? Dunno if that would change certain things, since I have never had the chance to experience it.

   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Quite a regular
Joined:
2013/10/17 15:21
From Hungary
Posts: 534
I have both of libqsqlite.so and libsqlite3.so at the correct places. Regarding the latter, I'm using the one that comes with OS4 (I think it was first introduces in Update 3). Is that one no good? I don't have OS4.1 FE, so that shouldn't be a problem.
Thanks for the tip, I'll try replacing it with the one you included in the Qt archive. I'll try running the example programs too.

_________________
I see the jimmies have been rustled.
   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Just can't stay away
Joined:
2012/8/14 12:51
From France
Posts: 1470
Hi,
I compiled and run many Qt SQLite program like SQLIteMan or QtWeb without problems.

Here is my Sobjs:libsqlite3.so

http://zzd10h.amiga-ng.org/Qt/libsqlite3.lha

Is it better ?

   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Quite a regular
Joined:
2013/10/17 15:21
From Hungary
Posts: 534
I checked out both libsqlite3.so files, and they are identical to the one I have, which came with the OS. All the SQL examples in Qt seems to work, which means the there is something in Brewtarget which prevents it from detecting any sql plugins on OS4.
https://gitorious.org/brewtarget/brewt ... c57:src/database.cpp#L179

_________________
I see the jimmies have been rustled.
   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Just can't stay away
Joined:
2009/10/7 0:11
From Copenhagen
Posts: 1186
@BSzili

The problem might be the use of QThreads (ie. pthreads). Try commenting out the following line, and see if it helps:

Database::Database()
{
//.setUndoLimit(100);
// Lock this here until we actually construct the first database connection.

///HERE:
// ---> _threadToConnectionMutex.lock();

Otherwise it could be a build issue. At least something obscure.

   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Quite a regular
Joined:
2013/10/17 15:21
From Hungary
Posts: 534
Thanks, I'll try that. What do you mean by build issue?

_________________
I see the jimmies have been rustled.
   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Just can't stay away
Joined:
2009/10/7 0:11
From Copenhagen
Posts: 1186
@BSzili

Well, one thing is: does it use cmake? Because that tends to make certain things easier and certain other things disasteously incomprehensible. Other build isues might be to structure code and build processes in ways, that are in theory consistent with how Qt works, but somehow not along the the lines of what it was intended to do. In which case it will most likely not have been taken into account by the amiga port. I've seen lots of those things happen over rime. Qthreads issues tend to be the most tricky, Because AmigaOS and pthreads on os4 tend to not always do exactly what other systems might do under the same conditions. With the added bonus, that you are now dealing with asynchronous code, so you don't have any idea whatsoever of what order things are actually happening in, let alone where your error messages are actually comming from (if you even get any).

   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Quite a regular
Joined:
2013/10/17 15:21
From Hungary
Posts: 534
I don't use CMake to built brewtarget, but a plain old makefile. I just noticed a few linker warnings during the rebult:
Quote:

ld: warning: libintl.so, needed by /qt/lib/libQtCore.so, not found (try using -rpath or -rpath-link)
ld: warning: libssl.so.1.0.0, needed by /qt/lib/libQtNetwork.so, not found (try using -rpath or -rpath-link)
ld: warning: libcrypto.so.1.0.0, needed by /qt/lib/libQtNetwork.so, not found (try using -rpath or -rpath-link)
ld: warning: libsqlite3.so, needed by /qt/lib/libQtSql.so, not found (try using -rpath or -rpath-link)


As far as error messages, I get none. I just don't have any available sql plugins.

_________________
I see the jimmies have been rustled.
   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Just can't stay away
Joined:
2009/10/7 0:11
From Copenhagen
Posts: 1186
@BSzili

Oh well, then that os why. You need to add sys:SObjs/ to your link library path. I think it is done with -L. Does it use qmake or no?

EDIT: it has the file CMakeLists.txt, so it uses cmake. Get cmake from os4depot and try again.


Edited by alfkil on 2015/1/19 18:44:54
   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Just can't stay away
Joined:
2006/12/4 23:15
Posts: 1883
@alfkil

Quote:

Oh well, then that os why. You need to add sys:SObjs/ to your link library path. I think it is done with -L. Does it use qmake or no?


For most sobjs there a link from sdk:local/newlib/lib/#?.so to the sobjs:#?.so


_________________
Blender For OS4.x : Blues : Walker Broad
   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Just can't stay away
Joined:
2009/10/7 0:11
From Copenhagen
Posts: 1186
@broadblues

But probably not for those. Hence the error.

   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Quite a regular
Joined:
2013/10/17 15:21
From Hungary
Posts: 534
@alfkil
Drats! I thought those were only linker warnings, and the sobjs are loaded at the program startup. I tried copying the missing files to sdk:local/newlib/lib, but it made no difference.
I know you ported CMake, but it crashes on my system (it gets into an endless loop), so I opted to use a makefile.

Edit: aha! Memory is a good thing, the more the better. Anywaya, for this problem, the reason the link fails, is that you have not added every dependency of every link object to the link line in your makefile. Ie. If libqtsql.so depends on libsqlite3.so, your link should look smth like this, that is with every nondependant object last:

ln <whatever> -l QSql <whatever > -l sqlite3 <whatever >

Otherwise the connection is not made, and your code will fail.


Edited by alfkil on 2015/1/21 19:09:32
Edited by alfkil on 2015/1/21 19:10:30
Edited by alfkil on 2015/1/21 19:10:48
Edited by alfkil on 2015/1/21 19:13:21
Edited by alfkil on 2015/1/21 19:13:50
_________________
I see the jimmies have been rustled.
   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Just can't stay away
Joined:
2009/10/7 0:11
From Copenhagen
Posts: 1186
@BSzili

CMake: have you set it up according to my instructions?

Another good option - perhaps the best - is to make a project file (.pro) and use qmake. There is probably a reason, though, for the authors not using qmake, so be prepared for this. You can find info on how to make qt project files at qt-project.org. Or just check out the example projects, it is very steaightforward.

   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Amigans Defender
Joined:
2006/11/17 22:40
From England
Posts: 3171
@BSzili

Quote:
Drats! I thought those were only linker warnings, and the sobjs are loaded at the program startup.


They are. If you get errors loading those files at startup you've got problems. Otherwise it shouldn't be relevant.

   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Just can't stay away
Joined:
2009/10/7 0:11
From Copenhagen
Posts: 1186
@Chris

In my experience, it is not irrelevant. I think there are instances of the linker needing to actually make the connection to rhe relevant symbols, although the details elude my memory. Anyways, just the indication, that the linker warnings still appear although thw relevant objects are in the lib directory, imdicates, that there is something wrong at the linker level.

Probably the problem is, that you forgot to add the rwlevant dependencies to you link. Ie.

ln <whatever> -l QtSql -l sqlite3

This is all handled automatically by the build process if you use qmake or cmake. Which is one of the many reasons to stick to those.


Edited by alfkil on 2015/1/21 19:17:58
   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Quite a regular
Joined:
2013/10/17 15:21
From Hungary
Posts: 534
Before creating a qmake project, I added
Quote:
-Wl,-rpath-link,/sobjs -L/sobjs
to the link flags in my Makefiles, and the warnings above went away. I still don't have any SQL drivers, so these warnings aren't seem to be related.
Is there any way to monitor where Qt tries to load its SQL plugins from?

edit: I fired up snoopy to see what's going on. This is what I get when Qt tries to open the SQL plugins:
Quote:
00621 : brewtarget : FAIL = Lock("/qt/home/.config/Trolltech.conf",SHARED) [55uS]
00622 : brewtarget : FAIL = Lock("/qt/home/.config/Trolltech.conf",SHARED) [26uS]
00623 : brewtarget : FAIL = Lock("/qt/home/.config/Trolltech.conf",SHARED) [32uS]
00624 : brewtarget : FAIL = Lock("/qt/home/.config/Trolltech.conf",SHARED) [26uS]
00625 : brewtarget : FAIL = Lock("/qt/home/.config/Trolltech.conf",SHARED) [30uS]
00626 : brewtarget : FAIL = Lock("/qt/home/.config/Trolltech.conf",SHARED) [26uS]
00627 : brewtarget : FAIL = Lock("/sqldrivers/.",SHARED) [35uS]
00628 : brewtarget : FAIL = Lock("/sqldrivers/.",SHARED) [24uS]


Edited by BSzili on 2015/1/23 14:06:39
Edited by BSzili on 2015/1/23 14:07:18
_________________
I see the jimmies have been rustled.
   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Just can't stay away
Joined:
2009/10/7 0:11
From Copenhagen
Posts: 1186
@BSzili

Well, it looks like it is looking for ...

sqlitedrivers:

...which is of course wrong. So something with path handling. Hmm.

It should of course be looking for Qt:plugins/sqldrivers. Maybe your Qt: assign is not set properly? Sometimes I have seen weird backtrack strategies for paths; which mean that a certain app works when somewhere in the Qt: directory but not when moved outside. Did you use the installer to install Qt or did you do it manually? If it doesn`t find the Trolltech config file, it could be a sign of something like that. Otherwise I have no clue at the moment.

   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Amigans Defender
Joined:
2006/11/17 22:40
From England
Posts: 3171
@alfkil

Actually, given that that is a Snoopy log, it is looking for /sqlitedrivers/. - which is doubly wrong.

First thing to do is link with -lunix to fix the paths.

   Report Go to top

Re: QSqlDatabase: QSQLITE driver not loaded
Just can't stay away
Joined:
2009/10/7 0:11
From Copenhagen
Posts: 1186
@Chris

Thank you, Chris! One of the other incountably many reasons to use an authorised build proceedure!

   Report Go to top


(1) 2 »



[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project