sqlite and Qt

Jochen Küpper jochen at fhi-berlin.mpg.de
Sun Nov 4 02:41:30 PST 2007


Hi Adam,

please keep the discussion on the macports-users list, so other are  
able to contribute to the issue as well.


To all: the problem is, that for Adam using the Qt4 SQlite support  
works when Qt4 is compiled with its internal sqlite library, but not  
when he uses the system (MacPorts) sqlite3, what the Portfile does.

>> What is the exact error message?
>
> It is a dialog box that pops up in the application that says  
> "Unable to open or create file Millbury_DB.  It is probably not a  
> database"

Well, that is not a very useful error message;) Which program does  
generate this message?
Can you tell Qt4 to give some more detailed pieces of information  
about the problem?

What kind of file is this exactly, i.e., by what version of sqlite  
was it generated?

> But I happened to know that it is, and that I can open it fine with  
> the command line version of sqlite as well as with the version that  
> I had built before the upgrade.

Is that the command-line version of sqlite from MacPorts?


If this is not a sqlite problem, I presume it is a problem of dynamic  
linkage...

What does otool say about the Qt4 plugin?
 > otool -L /opt/local/lib/qt4-plugins/sqldrivers/libqsqlite.dylib
/opt/local/lib/qt4-plugins/sqldrivers/libqsqlite.dylib:
         libqsqlite.dylib (compatibility version 0.0.0, current  
version 0.0.0)
         /opt/local/lib/libsqlite3.0.dylib (compatibility version  
9.0.0, current version 9.6.0)
         /opt/local/lib/libQtSql.4.dylib (compatibility version  
4.3.0, current version 4.3.2)
         /opt/local/lib/libQtCore.4.dylib (compatibility version  
4.3.0, current version 4.3.2)
         /opt/local/lib/libz.1.dylib (compatibility version 1.0.0,  
current version 1.2.3)
         /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,  
current version 88.3.9)
         /opt/local/lib/libiconv.2.dylib (compatibility version  
7.0.0, current version 7.0.0)
         /System/Library/Frameworks/ApplicationServices.framework/ 
Versions/A/ApplicationServices (compatibility version 1.0.0, current  
version 22.0.0)
         /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0,  
current version 7.4.0)
         /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0,  
current version 1.0.0)

If you have the same as me, does it help to say
   sudo install_name_tool -id /opt/local/lib/qt4-plugins/sqldrivers/ 
libqsqlite.dylib \
             /opt/local/lib/qt4-plugins/sqldrivers/libqsqlite.dylib
on e command-line? What does otool now give you?


> I just tried rebuilding Qt and then sqliteman a few different ways.
>  -system-sqlite
>  -system-sqlite -qt-sql-sqlite
> -qt-sql-sqlite
>
> The first two fail, as I described before.
> The last one works fine.

I assume the first two are identical (-system-sqlite apparently  
overwrites -qt-sql-sqlite). Specifying both does not make sense,  
anyway;)

I would prefer to use the system-libraries in Qt4, as otherwise we  
have at least two version of the same library installed on the  
system, like you have now (MacPorts sqlite3 + Qt4 sqlite)


Well, let's see where above points get us...

Greetings,
Jochen
-- 
Einigkeit und Recht und Freiheit                http://www.Jochen- 
Kuepper.de
     Liberté, Égalité, Fraternité                GnuPG key: CC1B0B4D
         Sex, drugs and rock-n-roll


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.macosforge.org/pipermail/macports-users/attachments/20071104/a0a9fa45/PGP.bin


More information about the macports-users mailing list