[Lazarus] Dynamic loading of a custom sqlite library

Max Vlasov max.vlasov at gmail.com
Wed Jun 8 16:27:40 CEST 2011


Hi,

I encountered problems using dynamically loaded sqlite library with lazarus
on linux.
My post about this in the sqlite list is here:
http://www.mail-archive.com/sqlite-users@sqlite.org/msg61565.html
Maybe someone points me to the right direction

It's about loading sqlite library with dlopen, getting all the methods with
dlsym and using it. I intentionally use different name and soname to not to
conflict with the system name (libsqlite3.so)

It works if I use default libsqlite3 library installed with ubuntu package
system in dlopen.

But if I compile the latest sqlite by myself or use configurable sqlite
download with default options, I get SIGSEGV errors inside sqlite code and
they appear inside dlopen is called (this is because sqlite3_initialize is
defined to be executed when the library is beeing loaded). Mostly the faults
are always about calling functions accessed from the global structure
(sqlite3GlobalConfig) related to mutexes or memory management (I found this
when compiled the library with debug info)

If I link the same 'problem' library with the sqlite shell (sqlite3), they
both work without any problem (so I can do all db manipulations in the
shell).

So I can not understand what is so special about the default installed
library and where should I look further.

Thanks in advance,

Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110608/1fbdd604/attachment-0002.html>


More information about the Lazarus mailing list