Can not load default Firebird clients (“libfbembed.so” or “libgds.so”). Check your installation

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);

11 thoughts on “Can not load default Firebird clients (“libfbembed.so” or “libgds.so”). Check your installation

  1. Pingback: Can not load default Firebird clients (“libfbembed.so” or “libgds.so”). Check your installation « Miaurs’s Blog

  2. Pingback: Firebird News » Can not load default Firebird clients (libfbembed.so or libfbclient.so). Check your installation

  3. 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

  4. 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

  5. The year is already 2015 and Lazarus in 1.4.2 (fpc 2.6.x)… and this article continue plenty useful.
    Thanks a lot!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s