hello,
I did a major mistake before - had extracted libfbclient.so from the latest Firebird installer (3.0.7). It has some additional dependencies which 3.0.5 (the one currently available in Ubuntu repositories) doesn't have. Now my program runs absolutely portable on Linux.
not a mistake, you can use the 3.0.7 version of firebird if you resolve the dependency errors :
here is how to install firebird client and embedded version on Ubuntu 20.04
1)
create a
firebird directory in your home directory
create a
plugins directory in this new directory
from the firebird 3 download
tar.gz file extract the files
libfbclient.so.3.0.x and
libEngine12.so :
put the file
libfbclient.so.3.0.x in the
firebird directory
put the file l
ibEngine12.so in the
firebird/plugins directory (for embedded)
in the
.profile file of your home directory add this line at this end of the file :
export FIREBIRD=/home/myusername/firebird
Example of use of embedded version of firebird3 in my example database in
lazarus/examples/database/image_mushroomsA) Modify the unit1.pas :
const
FirebirdDB='ImageTest.fdb'; //database file for Firebird
and
FUsingFirebird := true; // force Firebird first
if not(FUsingFirebird) then
add a component
TSQLDBLibraryLoader in the GUI of the project.
select the file l
ibfbclient.so.3.0.7 for the
LibraryName of the component
Enabled the component : if you have an error check the dependencies for the library
libfbclient.so.3.0.7 (
ldd command)
For example on Ubuntu 20.04 i have some dependencies error on l
ibncurses5 and
libtommath.so.0 to correct the dependencies :
sudo apt-get install libncurses5
sudo ln -s /usr/lib/x86_64-linux-gnu/libtommath.so.1 /usr/lib/x86_64-linux-gnu/libtommath.so.0
if all is good you must have something like this :
~/firebird$ ldd libfbclient.so.3.0.7
linux-vdso.so.1 (0x00007fff25dda000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f2687d60000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2687d5a000)
libncurses.so.5 => /lib/x86_64-linux-gnu/libncurses.so.5 (0x00007f2687d34000)
libtommath.so.0 => /lib/x86_64-linux-gnu/libtommath.so.0 (0x00007f2687d15000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2687b34000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f26879e5000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f26879c8000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f26879a5000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f26877b3000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2688160000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5
Enable the
TSQLDBLibraryLoader component
Run the program : if you have an exception error on not existing database file don't worry! click on
continue, the database file will be recreated from the backup file (.fbk).
Result in Attachment
For windows :
create a
firebird directory in a dev directory (ex:
D:\Dev)
create a
plugins directory in this new directory
from the firebird 3 download
zip file extract the files
fbclient.dll, icu*, engine12.dll :
put the files
fbclient.dll, icu* in the
firebird directory
put the file
engine12.dll in the
firebird/plugins directory (for embedded)
install the msvcrt libraries with the installer :
system32\vccrt10_x64.msi for the
libraryName property of the
TSQLDBLibraryLoader component select
fbclient.dllFriendly, J.P