title: Delphi 10.4 Firedac Error 314 on OSX Catalina
body: <p>How do I correctly provide the libfbclient.dylib for running Firedac/Firebird in OSX to avoid crashing with this message (here in German):</p>
  <pre><code>EFDException: [FireDAC][Phys][FB]-314. Laden der Herstellerbibliothek [libfbclient.dylib or libfbembed.dylib] nicht möglich.
  </code></pre>
  <p>To avoid some questions upfront: The software I am compiling already runs fine on Windows and Linux, in OSX it just wouldn't find the libfbclient.dylib. Also all non DB related unit tests run fine on all three platforms. And I made sure that the dylibs have 64 bitness like the executable, I took them from a fresh firebird 3 installation on the same Mac. The project is an application server (Windows service or Linux/OSX daemon).</p>
  <p>I create all components dynamically and usually store the fbclient and other required libraries in the a folder together with the executable as I never write things into customers system folders and try to avoid changing things like the system path whenever possible.</p>
  <pre><code>const
  {$IFDEF MSWINDOWS}
    CLIENTNAME = 'fbclient.dll';
  {$ENDIF}
  {$IFDEF LINUX}
    CLIENTNAME = 'libfbclient.so';
  {$ENDIF}
  {$IFDEF OSX}
    CLIENTNAME = 'libfbclient.dylib';
  {$ENDIF}     
  ...
  fDBLink := TFDPhysFBDriverLink.create(nil);
  fDBLink.vendorLib := IncludeTrailingPathDelimiter(extractFilePath(paramstr(0))) + CLIENTNAME;
  </code></pre>
  <p>The Embacadero documentations states the executable searches in the application folder first, so I also tried to omit setting the expicit verndorLib - no difference. I also tried the subfolder Contents/MacOS and the parent folder, also no difference.</p>
  <p>As I am not very used to the Unix platform I have no idea if there are system commands that can help finding out why(!) Firedac cannot load the library.</p>
  <p><strong>UPDATE 1</strong></p>
  <p>Meanwhile I discovered that I instanciated a TFDPhysFBDriverLink Object with every database instance what caused the VendorLib path being detected as empty in FDDriver. After correction the error message contains the complete path to libfbclient.dylib and I verified that it really lives there. I debugged into the Firedac code to where the Library is loaded with <code>LoadLibrary</code>: The path is correct and still it returns 0 in OSX.</p>