[Lazarus] sqlite3 app on linux

Michael Van Canneyt michael at freepascal.org
Thu Oct 14 15:51:19 CEST 2010



On Thu, 14 Oct 2010, Andrea Mauri wrote:

> dear all,
> I am working on an app using sqlite. I use sqlite3connection.
> My app is actually completed and I am preparing the "installer".
> For Linux I made a deb and a rpm package including the dependency to 
> libsqlite3-0.
> The installing procedure works fine but when I run my app I get:
>
> can not load sqlite client library libsqlite3.so
>
> In usr/lib I have only libsqlite3.so.0, if a make a symlink libsqlite3.so.0 
> to libsqlite3.so the app works fine.
>
> My questions are:
> why sqlite3connection looks specifically to libsqlite3.so? I am not a linux 
> expert but I found that also on another pc with ubuntu I have libsqlite3.so.0 
> and not libsqlite3.so.
>
> how can I resolve this issue? may I put a postinst script in the deb package 
> in order to create the symlink? if the symlink already exists? someone can 
> suggest me how this script should be?
>
> there are some others workaround?

Yes. Put the following in the startup code of your app:

uses sqlite3dyn;

begin
   InitializeSqlite('libsqlite3.so.0');
end;

More sophisticated would be to detect which file actually exists, and use
the correct filename.

Michael.




More information about the Lazarus mailing list