Cannot load DB-Lib "libsybdb.so" lazarus / 16-Databases ---------------------------------------------------------------------- Edson · 2016-12-02 18:18 Trying to connect to Sybase DB, from CentOS 6.8 - fpc 3.0.0. I Get QuoteEInOutError/Can not load DB-Lib client library "libsybdb.so". Check your installation. I have installed "freetds", before and can connect correctly using fisql and tsql. I have libsybdb.so: Quote[usuario@CENTOS-64 ~]$ find / -name libsybdb.so /home/usuario/freetds-1.00/src/dblib/.libs/libsybdb.so /usr/local/lib/libsybdb.so I have tried creating a link: ln -s /home/usuario/freetds-1.00/src/dblib/.libs/libsybdb.so /lib/libsybdb.so but not success Any help would be appreciated? ---------------------------------------------------------------------- vrull · 2016-12-08 23:53 I think your program is looking for /usr/lib/libsybdb.so instead of /usr/local/lib/libsybdb.so. Try Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i SQLDBLibraryLoader.LibraryName := '/usr/local/lib/libsybdb.so'; // full path hereSQLDBLibraryLoader.ConnectionType := 'Sybase';SQLDBLibraryLoader.Enabled := true;SQLDBLibraryLoader.LoadLibrary; ---------------------------------------------------------------------- Edson · 2016-12-13 21:18 I don't know exactly, how to use SQLDBLibraryLoader. I hope it's OK in my code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program tisql;{$mode objfpc}{$H+}uses  {$IFDEF UNIX}{$IFDEF UseCThreads}  cthreads,  {$ENDIF}{$ENDIF}  Classes,  SysUtils, db, sqldb, Dialogs, sqldblib,  mssqlconn; // mssqlconn was added to 2.6.1, you need a recent 2.6.1var  Connection: TSybaseConnection;  SQLTransaction1: TSQLTransaction;  SQLQuery1: TSQLQuery;  SQLDBLibraryLoader1: TSQLDBLibraryLoader;begin  SQLDBLibraryLoader1 := TSQLDBLibraryLoader.Create(nil);  SQLDBLibraryLoader1.LibraryName := '/usr/lib/libsybdb.so'; // full path here  SQLDBLibraryLoader1.ConnectionType := 'Sybase';  SQLDBLibraryLoader1.Enabled := true;  SQLDBLibraryLoader1.LoadLibrary;   Connection:= TSybaseConnection.Create(nil);  SQLTransaction1:= TSQLTransaction.Create(nil);  SQLQuery1:= TSQLQuery.Create(nil);   Connection.UserName:='sa';  Connection.Password:='xxx';  Connection.HostName:='192.168.1.33'+':'+'5000';  Connection.DatabaseName:='master';   SQLTransaction1.DataBase:=Connection;  SQLQuery1.DataBase:=Connection;  SQLQuery1.SQL.Text := 'select dbname, suid, status  from syslogins';  try    Connection.Connected:=true;  except    on E: Exception do    begin      writeln('Error connecting to database: '+E.ClassName+'/'+E.Message);    end;  end;  try    SQLquery1.Open;    SQLquery1.First;    while not SQLquery1.EOF do    begin      writeln(SQLquery1.FieldByName('dbname').AsString);      SQLquery1.Next;    end;  except    writeln('Error ejecutando consulta.');  end;   writeln('hola mundo');   SQLQuery1.Destroy;  SQLTransaction1.Destroy;  Connection.Destroy;//  readln;  SQLDBLibraryLoader1.Destroy;end.  It compiles, but when exec: QuoteAn unhandled exception occurred at $000000000052B51F: EInOutError: Can not load DB-Lib client library "libsybdb.so". Check your installation. Success   $000000000052B51F   $00000000004BCB76 ---------------------------------------------------------------------- Thaddy · 2016-12-13 21:24 If there is a correct installation in /usr/lib/ or /usr/local/lib/ there is never the need for a full path. Your installation is wrong, or your header file is wrong. Check the libname in your header file/interface unit first, otherwise your installation is wrong or non-existent. ---------------------------------------------------------------------- Edson · 2016-12-15 18:18 Quote from: Thaddy on December 13, 2016, 10:24:15 pmIf there is a correct installation in /usr/lib/ or /usr/local/lib/ there is never the need for a full path. Your installation is wrong, or your header file is wrong. Check the libname in your header file/interface unit first, otherwise your installation is wrong or non-existent. I don't think the installation is wrong because the "fisql" tool, can connect correctly in this Centos. Moreover, the same program (without TSybaseConnection) runs OK in a Ubuntu PC. What is my header file? ---------------------------------------------------------------------- Edson · 2016-12-16 17:02 Tested with another installation of FreeTDS: Quote[usuario@CENTOS-64 ~]$ tsql -C Compile-time settings (established with the "configure" script)                             Version: freetds vdev.1.00.106              freetds.conf directory: /usr/local/etc      MS db-lib source compatibility: no but not success  : It still showing the message: QuoteEInOutError/Can not load DB-Lib client library "libsybdb.so". Check your installation. But I can connect correctly with fisql: Quote[usuario@CENTOS-64 ~]$ fisql -S SILICIO1 -U sa -P xxx -i a.sql -n Changed database context to 'master'. dbname                         suid        status master                         1           0    sybsystemdb                    2           0    master                         3           0    master                         4           8 ---------------------------------------------------------------------- Thaddy · 2016-12-16 17:47 your header file is the interface unit to libsybdb.so That probably contains an error in the name or the version. ---------------------------------------------------------------------- marcov · 2016-12-16 18:19 Something security oriented like Centos may have the standard *nix protection that libraries can only be loaded from directories known to the library loader. These directories are configured with the "ldconfig" tool. ---------------------------------------------------------------------- Edson · 2016-12-16 19:15 Finally success  . I'm using: Quote  SQLDBLibraryLoader1 := TSQLDBLibraryLoader.Create(nil);   SQLDBLibraryLoader1.ConnectionType := 'Sybase';   SQLDBLibraryLoader1.LibraryName := '/usr/lib/libsybdb.so'; // full path here   SQLDBLibraryLoader1.Enabled := true;   SQLDBLibraryLoader1.LoadLibrary; The key is putting:   SQLDBLibraryLoader1.ConnectionType := 'Sybase'; just after creating the object, like indicated in http://wiki.freepascal.org/TSQLDBLibraryLoader I don't know, why it's needed to use TSQLDBLibraryLoader, but it's the only way it works for me.