On macOS, I tried putting libfbclient.dylib (and other libraries from the Firebird installation) inside of the app bundle. No luck. Then I tried to put the entire server as a framework inside of the bundle. Also, no luck. So the question is: how do I use libfbclient.dylib on macOS? How to bundle it with myprogram.app, and what else should be changed for the app to find it?
If I'm not confusing anything - it should be available for the libfbclient.so.2 loader (symlink) and should point to libfbclient.so.
You can put both files (.so and .so.2) next to the program binary, but before running it, set LD_LIBRARY_PATH and FIREBIRD to point to the .so directory.
Place the firebird.conf and .msg files in the same directory as the client library if necessary.
I just used the TSQLDBLibraryLoader component to load libfbclient.so from the program's folder.here is why :
For SQLDB database connectors, at least recent FPC versions try to load some default library names, but may fail. Using SQLDBLibraryLoader, you can specify the exact filename to load.
SQLDBLibraryLoader needs to be called before loading/enabling TSQLConnection components.
Note that often you can do a similar thing by setting the library name for the TSQLConnection descendant you are using. This does depend on that TSQLConnection descendant supporting that functionality.
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 :
export FIREBIRD=/home/myusername/firebird
sudo apt-get install libncurses5if all is good you must have something like this :
sudo ln -s /usr/lib/x86_64-linux-gnu/libtommath.so.1 /usr/lib/x86_64-linux-gnu/libtommath.so.0
~/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
For example on Ubuntu 20.04 i have some dependencies error on libncurses5 and libtommath.so.0
to correct the dependencies :Quotesudo 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
I'm trying to incorporate fbclient into a portable app for redistribution on major platforms (Unix/Windows).
Server: Firebird 3.0.7 x64,
macOS Catalina (doesn't work at all).