Recent

Author Topic: Can't load Sqlite client library "libsqlite3.so".Check your installation-Ubuntu  (Read 19178 times)

Goodman H__

  • Full Member
  • ***
  • Posts: 130
I got the subjected error message under Ubuntu 10 when I test sqlite3 DB connection.What does this mean,how can I fixed?I checked the system do have libsqlite3.so installed under \use\lib.Below is what I did :

In the form I placed a sqlite3connection,in the property field databaseName I entered mydb.db3 which is in the same folder with the project.Now I tried to change active to true,I got the error message.

It would be grateful if anybody can help.

Regrds,
Sam
fpc:2.6.1 Lazarus:1.1 SVN39277
OS:win 7

stonefull

  • Jr. Member
  • **
  • Posts: 51
Try

sudo apt-get install libsqlite3-dev

devEric69

  • Sr. Member
  • ****
  • Posts: 384
Try copying your library libsqlite3.so, into /usr/lib (executables search for libraries in a set of places, e.g. /lib, /usr/lib, /usr/local/lib,... so if you do not put your .so file in one of these places like /usr/local/lib, it might be a good place).
« Last Edit: March 19, 2019, 02:05:43 pm by devEric69 »
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

Thaddy

  • Hero Member
  • *****
  • Posts: 10586
Try copying your library libsqlite3.so, into /usr/lib (executables search for libraries in a set of places, e.g. /lib, /usr/lib, /usr/local/lib,... so if you do not put your .so file in one of these places like /usr/local/lib, it might be a good place).
That's probably worse, since sqlite is already present on most systems (except the headers).

Try this first and report back:
Code: Bash  [Select][+][-]
  1. cd /
  2. sudo find -name libsqlite3.so*
  3.  
That wil give you something like this:
Code: Text  [Select][+][-]
  1.  sudo find -name libsqlite3.so.*
  2. ./usr/lib/arm-linux-gnueabihf/libsqlite3.so.0.8.6
  3. ./usr/lib/arm-linux-gnueabihf/libsqlite3.so.0
  4.  
Now just make a symlink to one of the last two that is called
Code: Bash  [Select][+][-]
  1. libsqlite3.so
  2. # like
  3. /usr/local/lib/libsqlite3.so
  4. # or
  5.  /usr/lib/libsqlite3.so
  6. #  (better to do the first one)
The reason is that there are multiple versions and none of them are symlinked to the proper - default - name.
« Last Edit: March 19, 2019, 03:08:53 pm by Thaddy »

devEric69

  • Sr. Member
  • ****
  • Posts: 384
Thank you for responding.
To make sure I understand, I just have to make a link like this:
Code: Bash  [Select][+][-]
  1.                              ↙--------------------------------------------↖
  2. ln    -sf    /usr/lib/arm-linux-gnueabihf/libsqlite3.so.0    /usr/lib/libsqlite3.so
  3.  
  4.  

( Besides: one thing that bothered me and that I didn't understand, that's why the symlink called libsqlite3.so.*0*. Why libsqlite3.so.0 instead of just libsqlite3.so? I found the explanation in this page (http://wiki.freepascal.org/SQLite/fr), paragraph "§ Cas de Debian Jessie": "[SNIP] Debian Jessie only offers the symbolic link libsqlite3.so.0. [/SNIP]" ==> from this historical limitation, the symlink is named libsqlite3.so.0 )
« Last Edit: June 26, 2020, 06:47:28 pm by devEric69 »
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8900
  • FPC developer.
Thank you for responding.
To make sure I understand, I just have to make a link like this:

                                      ↙--------------------------------------------↖
ln    -sf    /usr/lib/arm-linux-gnueabihf/libsqlite3.so.0    /usr/lib/libsqlite3.so

Yes. Stonefull's suggestion to install the -dev package should also work.

The sqlite3.so is the development target, the .so.0 the runtime target.




Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1072
    • Burdjia
Update:  Today the problem persists.  The fix is exactly the same.  Is it still in development?
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

PascalDragon

  • Hero Member
  • *****
  • Posts: 2427
  • Compiler Developer
I think you misunderstand what “development” means in this context. This does not mean that it's the actively worked on version of SQLite (like trunk in FPC). Instead installing a -dev package on Debian-like systems means to install the headers as well as a symlink so that compilers/linkers can simply link against xxx.so which will be resolved to the correct version at link time (thus the final executable will require xxx.so.y). The end user does not need the development links in that case.

Though of course this will break if a dynamic mechanism with LoadLibrary is used...

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1072
    • Burdjia
The end user does not need the development links in that case.
I understand that the development version is needed to build (develop) the application, but problem is that the development version is needed to run the final executable and it shouldn't.

But the culprit are the SQLite development team:  they didn't include the libsqlite3.so link in the release package, but in the development one!
« Last Edit: September 12, 2020, 11:33:04 am by Ñuño_Martínez »
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

lucamar

  • Hero Member
  • *****
  • Posts: 3236
But the culprit are the SQLite development team:  they didn't include the libsqlite3.so link in the release package, but in the development one!

It shouldn't be needed; the "dynamic loading" mechanism of the OS should already have an "alias" so that when an application calls for a .so it loads in fact a .so.X.Y without the need of a symlink.

Note also that, generally speaking, the distro package is not made by the (in this case SQLite) developers but by some distro package maintainer(s), someone at Canonical or Debian in Ubuntu's case.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.10/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

MarkMLl

  • Hero Member
  • *****
  • Posts: 1455
It shouldn't be needed; the "dynamic loading" mechanism of the OS should already have an "alias" so that when an application calls for a .so it loads in fact a .so.X.Y without the need of a symlink.

Note also that, generally speaking, the distro package is not made by the (in this case SQLite) developers but by some distro package maintainer(s), someone at Canonical or Debian in Ubuntu's case.

It /is/ needed, and responsibility lies with the distro maintainers.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

 

TinyPortal © 2005-2018