Recent

Author Topic: [SOLVED]Can't load SQLite client library  (Read 1168 times)

bubu42

  • Newbie
  • Posts: 2
[SOLVED]Can't load SQLite client library
« on: August 25, 2022, 03:39:50 pm »
Hello,
That's been quite a long time since I last used Lazarus (actually over 8 years, on Windows XP).
Now, I'm trying to build a new application, using SQLite3 on Ubuntu (Linux). Things seem to quite different from Win XP !
I've installed SQLite3 on my machine, but when I try to Connect the TSQLite component I get the error message : Cannot load SQLite3 library (libsqlite3.so). Check your installation.
I've copied the libsqlite3.so file from /usr/lib/i386-linuxgnu into my application folder, but it doesn't seem to help.
What am I doing wrong ? Any advice welcome !
Thanks in advance.
« Last Edit: August 25, 2022, 11:32:21 pm by bubu42 »

kapibara

  • Hero Member
  • *****
  • Posts: 649
Re: Can't load SQLite client library
« Reply #1 on: August 25, 2022, 04:34:53 pm »
You just need to install the package libsqlite3-dev in Ubuntu.
Remove the .so file that you copied manually.
Lazarus trunk / fpc 3.2.2 / Kubuntu 24.04 - 64 bit

MarkMLl

  • Hero Member
  • *****
  • Posts: 8382
Re: Can't load SQLite client library
« Reply #2 on: August 25, 2022, 04:55:08 pm »
You just need to install the package libsqlite3-dev in Ubuntu.
Remove the .so file that you copied manually.

Detail: the -dev package sets up a symlink that the normal package omits.

I'm not sure, but https://wiki.freepascal.org/TSQLDBLibraryLoader might be relevant as an alternative, but I've not done any heavyweight database-related development since it was added (before that, I either installed the -dev package where needed or did my own library search).

I must say that having to install a development package on an end-user's system is a very unsatisfactory situation. However this is fundamentally a Debian issue (inherited by Ubuntu), rather than a Lazarus/LCL/FPC one.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Zvoni

  • Hero Member
  • *****
  • Posts: 2961
Re: Can't load SQLite client library
« Reply #3 on: August 25, 2022, 04:57:01 pm »
Don't forget 32-Bit vs. 64-Bit
i see a "i386..." above
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

MarkMLl

  • Hero Member
  • *****
  • Posts: 8382
Re: Can't load SQLite client library
« Reply #4 on: August 25, 2022, 05:06:32 pm »
Don't forget 32-Bit vs. 64-Bit
i see a "i386..." above

I saw that as well, but since he provided the entire source path and didn't say that he'd moved it between systems decided to give him the benefit of the doubt...

I've not got any significant SQLite stuff on the system in front of me, but I do note

Code: Text  [Select][+][-]
  1. ~$ locate libsqlite3.so
  2. /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
  3. /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
  4.  

For the purpose of comparison, the fairly complete PostgreSQL installation (i.e. explicitly including the -dev package) has

Code: Text  [Select][+][-]
  1. ~$ locate libpq.so
  2. /usr/lib/x86_64-linux-gnu/libpq.so -> libpq.so.5.11
  3. /usr/lib/x86_64-linux-gnu/libpq.so.5 -> libpq.so.5.11
  4. /usr/lib/x86_64-linux-gnu/libpq.so.5.11
  5.  

... and an app looking for either libpq.so or libpq.so.5 will be sent to the actual library file libpq.so.5.11

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

bubu42

  • Newbie
  • Posts: 2
Re: Can't load SQLite client library
« Reply #5 on: August 25, 2022, 07:28:36 pm »
Thanks a lot, folks ! That did it.
Actually, the 32/64 bits thing was the origin. I also checked the symlink.

 

TinyPortal © 2005-2018