[Qt-interest] SQLite: no functions are exported

Robert Hairgrove evorgriahr at hispeed.ch
Fri Feb 25 16:51:47 CET 2011


System is Linux Ubuntu 10.04 LTS, Qt is 4.7.1 built from sources (LGPL).

I compiled Qt with the configure switch "-no-reduce-exports" in an
attempt to be able to access native SQLite functions from my app. I
added SQLite support with "-plugin-sql-sqlite".  In the qmake project
file "qpluginbase.pri", there is the following line:

line 11: contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols

Running "nm libqsqlite.so" on the plugin .so file, it appears that all
of the native "sqlite3_" functions are indeed exported, e.g.:

...
0003a900 T sqlite3_vfs_find

...is included in the output (unless I misunderstood the nm man page:
"T", being upper-case, is public, and lower-case "t" being local...)

Obviously, none of these functions appear when I run "nm" on
libQtSql.so.4.7.1. because Qt cannot know at compile time what SQL
drivers it will need to support.

So is there some other mechanism which can expose the functions exported
from the plugin .so, but avoid having two instances of SQLite in my app
and still be able to take advantage of the QtSql functionality?




More information about the Qt-interest-old mailing list