<br><br><div class="gmail_quote">On Wed, Jun 8, 2011 at 6:27 PM, Max Vlasov <span dir="ltr"><<a href="mailto:max.vlasov@gmail.com">max.vlasov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br><br>I encountered problems using dynamically loaded sqlite library with lazarus on linux. <br>My post about this in the sqlite list is here: <a href="http://www.mail-archive.com/sqlite-users@sqlite.org/msg61565.html" target="_blank">http://www.mail-archive.com/sqlite-users@sqlite.org/msg61565.html</a><br>
Maybe someone points me to the right direction<br><br>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)<br>
<br>It works if I use default libsqlite3 library installed with ubuntu package system in dlopen.<br><br>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). <br>
...<br></blockquote></div><br>Finally found that this was because sqlite3 was in the uses list, so actually it was scenario when fpc linked sqlite dynamically and besides I did my own dynamic loading with my own unit of another version/file of sqlite. So probably there was a conflict with shared data. In my case it looks like everything was ok if the linked library and loaded was the same file (system libsqlite3.so). But if linked was system libsqlite3.so and my loaded was a library with a different name/soname the faults took place. <br>
<br>Just curious, such things occasionally can happen from time to time. Is this about the way sqlite library is compiled so no two independent copies of the library coexist dynamically linked/loaded due to intersetion of the shared data. Or this is about the way linux handles them? <br>
<br>Thanks<br><br>Max<br>