If you are using Free Pascal / Lazarus to develop applications that needs to access FireBird database, or you need to run applications that has been written using FreePascal/Lazarus and Firebird database, make sure you have installed Firebird client library.
If you have installed FireBird database engine (server) in the same machine, that means you already have this library installed, but for thee client machines you need to do the followings:
In windows you can install the client library from the same server packages that you can get from this link:
http://www.firebirdsql.org/en/server-packages/
This time choose Minimal client only installation.
In Linux you can install libfbclient2 package. For instance in Debian family you can execute this command:
sudo apt-get install libfbclient2
After installing Firebird client package you will get libraries like this in default Linux library directory:
/usr/lib/i386-linux-gnu/libfbclient.so.2 /usr/lib/i386-linux-gnu/libfbclient.so.2.5.1
Lazarus applications are still can not access them. You need to make a symbolic link by the default name to make FreePascal/Lazarus applications be able to load Firebird library.
In older versions of Linux you can do it like this:
sudo ln /usr/lib/libfbclient.so.2 /usr/lib/libfbclient.so
In newer versions of Linux use one of these two commands:
For 32 bit Linux:
sudo ln /usr/lib/i386-linux-gnu/libfbclient.so.2 /usr/lib/i386-linux-gnu/libfbclient.so
For 64 bit Linux:
sudo ln /usr/lib/x86_64-linux-gnu/libfbclient.so.2 /usr/lib/x86_64-linux-gnu/libfbclient.so
Also you can check Firebird library existence from your FreePascal/Lazarus code by doing the followings:
1. Add dynlibs in main project source code
2. Write this code before creating forms at main project code:
{$IFDEF Unix} {$DEFINE extdecl:=cdecl} fbclib = 'libfbclient.' + sharedsuffix; {$ENDIF} {$IFDEF Windows} {$DEFINE extdecl:=stdcall} fbclib = 'fbclient.dll'; seclib = 'gds32.dll'; {$ENDIF} {$R *.res} var IBaseLibraryHandle : TLibHandle; begin IBaseLibraryHandle:= LoadLibrary(fbclib); {$IFDEF Windows} if IBaseLibraryHandle = NilHandle then IBaseLibraryHandle:= LoadLibrary(seclib); {$ENDIF} // Check Firebird library existance if (IBaseLibraryHandle = nilhandle) then Application.MessageBox('Unable to load Firebird library: ' + #10 + fbclib, 'Warning', 0); Application.Initialize; Application.CreateForm(TfmMain, fmMain);
Pingback: Can not load default Firebird clients (“libfbembed.so” or “libgds.so”). Check your installation « Miaurs’s Blog
Pingback: Firebird News » Can not load default Firebird clients (libfbembed.so or libfbclient.so). Check your installation
Very useful article, thanks, but have you installed firebird in MAC?, i’m a windows user, i do not know so much about linux (unix), I have do every thing with out success, how can i install in MAC?
Thanks in advanced
Rafael Liriano
I have never used Mac computer before, but I have a friend who compiles TurboBird in Mac for me, I’ll ask him to help you
Thanks, for your respond. I’m waiting for your help.
Thanks in advanced
Rafael liriano
Hi, any news about installing libraries on Mac ? I need some help, too.
Thanks for your attention
Marco
I’ve asked for help on this issue on this thread:
http://www.lazarus.freepascal.org/index.php/topic,19524.msg111177.html#msg111177
I have googled so long before finding this article which helped me. Thank you very much. I need to know what is the best component for accessing firebird from lazarus ubuntu. Thanks
I have used only native Lazarus IBConnection component and other database components from sqldb tools page
The year is already 2015 and Lazarus in 1.4.2 (fpc 2.6.x)… and this article continue plenty useful.
Thanks a lot!
on raspberry pi you can find the libfbclient.so.* in /usr/lib/arm-linux-gnueabihf/