How does FPC determine which SQLite shared library to link to on Linux? lazarus / 63-Database ---------------------------------------------------------------------- PierceNg · 2020-08-23 12:29 I'm on Ubuntu and Alpine Linux. I'm using this SQLite binding:   https://github.com/plashenkov/SQLite3-Delphi-FPC Example program: 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 dbtest; {$mode objfpc}{$H+} uses  SQLite3Wrap; const  DatabaseFileName = 'x.db';  Schema = 'create table if not exists x (' +    'id integer primary key, ' +    'x varchar' +    ')';  InsertSQL = 'insert into x values (NULL, ?)'; var  db: TSQLite3Database;  stmt: TSQLite3Statement; begin  try    db := TSQLite3Database.create;    db.open(DatabaseFileName);     db.beginTransaction;    db.execute(Schema);    db.commit;     stmt := db.prepare(InsertSQL);  stmt.bindText(1, '42');    db.beginTransaction;    stmt.stepAndReset;    db.commit;  finally    stmt.free;    db.free;  end;end.  The SQLite binding defines the following: 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 const{$IFDEF MSWINDOWS}  sqlite3_lib = 'sqlite3.dll';{$ENDIF}{$IFDEF UNIX}  sqlite3_lib = 'sqlite3.so';{$ENDIF}{$IFDEF DARWIN}  sqlite3_lib = 'libsqlite3.dylib';{$ENDIF} All SQLite functions are declared in similar style: 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 function sqlite3_libversion: PAnsiChar; cdecl; external sqlite3_lib; Compile my example program: Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i % fpc dbtest.pasfpc dbtest.pasFree Pascal Compiler version 3.2.0 [2020/07/07] for x86_64Copyright (c) 1993-2020 by Florian Klaempfl and othersTarget OS: Linux for x86-64Compiling dbtest.pasLinking dbtest42 lines compiled, 0.2 sec By default the executable links to the system-provided SQLite shared library: Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i % ldd dbtest        linux-vdso.so.1 (0x00007ffdad689000)        libsqlite3.so.0 => /lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007ff044862000)        libm.so.6 => /lib/x86_64-linux- gnu/libm.so.6 (0x00007ff044713000)        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff0446f0000)        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff0446ea000)      libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff0444f8000)        /lib64/ld-linux-x86-64.so.2 (0x00007ff0449a4000) How to tell FPC to link to my self-compiled libsqlite3.so? I want to use my own libsqlite3.so to make sure that the SQLite functionality my program uses is indeed in the shared library the program links to. ---------------------------------------------------------------------- julkas · 2020-08-23 12:50 See option -Fl - https://www.freepascal.org/docs- html/current/user/userap1.html ---------------------------------------------------------------------- PierceNg · 2020-08-23 15:24 Quote from: julkas on August 23, 2020, 02:50:04 pmSee option -Fl - https://www.freepascal.org/docs-html/current/user/userap1.html Thank you.