[SOLVED] Firebird embedded lazarus / 16-Databases ---------------------------------------------------------------------- Handoko · 2023-04-20 19:27 ---edit--- Problem solved. The instruction for Firebird Embedded on Linux is here: https://forum.lazarus.freepascal.org/index.php/topic,63142.msg478478.h tml#msg478478 Quote from: Thaddy on July 06, 2022, 06:54:25 pmJust do not use Firebird. I didn't believe it but it seems I now have to agree with Thaddy. Someone, please prove me wrong! Short story: I am not good in database programming but I am very good in using TDbf. COVID means less jobs but plenty of time for me. I used the time studying SQL and understood how to use SQLite. I created some tests and knew that SQLite is roughly 8x faster than TDbf. But some said SQLite is not a good database so I later learned how to use Firebird. Problems: For some reasons, I need to use Firebird embedded. The documentation and information on the Firebird 3 embedded for Linux topic is extremely rare. All of them are for versions below 3. FYI, version 5.0 beta 1 is now ready for download. How I test: I use Ubuntu Mate 19.10 64-bit + Lazarus 2.3.0 + Firebird 3. I created a small program for runtime creating table and inserting data, and I run it on a Ubuntu Mate 18.04 64-bit virtual machine. I have tried all the things I found on the web, but I only got connection error. It could be solved only if I install Firebird 3 on the virtual machine. I used TIBConnection (not IBX). Questions: - Have anyone managed to use Firebird embedded version 3 or 4 on Linux? - If yes, how to do it? The only advantage of using Firebird, to me is able to switch between embedded and client-server mode with minimal effort. But if it can't work for version 3 or 4 on Linux, I will go to the industry standard or at least SQLite. ---------------------------------------------------------------------- dsiders · 2023-04-20 19:58 Quote from: Handoko on April 20, 2023, 09:27:53 pmQuote from: Thaddy on July 06, 2022, 06:54:25 pmJust do not use Firebird. I didn't believe it but it seems I now have to agree with Thaddy. Someone, please prove me wrong! Short story: I am not good in database programming but I am very good in using TDbf. COVID means less jobs but plenty of time for me. I used the time studying SQL and understood how to use SQLite. I created some tests and knew that SQLite is roughly 8x faster than TDbf. But some said SQLite is not a good database so I later learned how to use Firebird. Problems: For some reasons, I need to use Firebird embedded. The documentation and information on the Firebird 3 embedded for Linux topic is extremely rare. All of them are for versions below 3. FYI, version 5.0 beta 1 is now ready for download. How I test: I use Ubuntu Mate 19.10 64-bit + Lazarus 2.3.0 + Firebird 3. I created a small program for runtime creating table and inserting data, and I run it on a Ubuntu Mate 18.04 64-bit virtual machine. I have tried all the things I found on the web, but I only got connection error. It could be solved only if I install Firebird 3 on the virtual machine. I used TIBConnection (not IBX). Questions: - Have anyone managed to use Firebird embedded version 3 or 4 on Linux? - If yes, how to do it? The only advantage of using Firebird, to me is able to switch between embedded and client-server mode with minimal effort. But if it can't work for version 3 or 4 on Linux, I will go to the industry standard or at least SQLite. Sounds like you're expecting the fb client to be part of your compiled executable. It's not. Perhaps they should have called it Firebird Serverless instead of embedded. You need a copy of the firebird client where the .FDB file is installed. It's a local connection, and the library is dynamic. ---------------------------------------------------------------------- Handoko · 2023-04-20 20:03 Quote from: dsiders on April 20, 2023, 09:58:40 pmYou need a copy of the firebird client where the .FDB file is installed. It's a local connection, and the library is dynamic. I tried but not did not work. I even installed libfbclient2 package using Synaptic Package Manager, the libfbclient2 is provided on Ubuntu Software Center. ---------------------------------------------------------------------- dsiders · 2023-04-20 20:15 Quote from: Handoko on April 20, 2023, 10:03:51 pmQuote from: dsiders on April 20, 2023, 09:58:40 pmYou need a copy of the firebird client where the .FDB file is installed. It's a local connection, and the library is dynamic. I tried but not did not work. I even installed libfbclient2 package using Synaptic Package Manager, the libfbclient2 is provided on Ubuntu Software Center. Isn't libfbclient2 for firebird 2.X? You said you were using FB3. ---------------------------------------------------------------------- Handoko · 2023-04-20 20:27 I copied/pasted libfbclient from FB3. I also tried install libfbclient2 (which the package manager said: version 3.0.5, see the screenshot below). Even weirder, the compiled binary (server mode) can run but got connection error on the newly installed server machine, which already have Firebird 3 server installed. It only worked correctly if I also install the firebird-dev package. ---------------------------------------------------------------------- dsiders · 2023-04-20 20:42 Quote from: Handoko on April 20, 2023, 10:27:43 pmI copied/pasted libfbclient from FB3. I also tried install libfbclient2 (which the package manager said: version 3.0.5, see the screenshot below). Even weirder, the compiled binary (server mode) can run but got connection error on the newly installed server machine, which already have Firebird 3 server installed. It only worked correctly if I also install the firebird-dev package. Requiring the dev package sounds pretty standard for the server install... but I don't know about for just the client. I'm out of my league when it comes to Ubuntu. ---------------------------------------------------------------------- dsiders · 2023-04-20 22:42 Quote from: Handoko on April 20, 2023, 10:27:43 pmI copied/pasted libfbclient from FB3. I also tried install libfbclient2 (which the package manager said: version 3.0.5, see the screenshot below). Even weirder, the compiled binary (server mode) can run but got connection error on the newly installed server machine, which already have Firebird 3 server installed. It only worked correctly if I also install the firebird-dev package. I stumbled across these: https://docs.huihoo.com/firebird/manual/ufb-cs.html https://www.ibphoenix.com/files/Embedded_fb3.pdf It does discuss some Linux-specific things. Maybe this'll help a little. ---------------------------------------------------------------------- Handoko · 2023-04-21 04:11 Of course I had read the pdf before I started the questions here. For doing Firebird Embedded version 3 and 4 on Windows, they are relatively easy. After  some research on the Internet and testing, I managed to find out the minimum files needed for Firebird Embedded but for Windows only. If anyone interested, the see the attached picture. I always write and save the information if I found something useful. QuoteEmbedded in Firebird 3 Everything you need for deploying Firebird 3 embedded with your application is present in the .zip (Windows) or .tar.gz (Linux) kit that you download from the Firebird website. We'll work with mainly with the Windows zip kit here, but the principle is the same for the Linux kit: unzip the Windows kit into its own folder or decompress and untar the Linux one into its own directory. There are differences between structures of the file systems now, specifically in the location of the binary files: Linux retains them in the /bin directory beneath the Firebird root, whereas Windows has them all directly in the Firebird root. The pdf tutorial in the link you gave is for Windows - as I quoted above - it says the principle is the same for Linux. But no, it didn't work on my test. And, the information on the first link is not applicable on Firebird 3 Linux because the mentioned files libfbembed.so and libgds* are no where to be found. ---------------------------------------------------------------------- dsiders · 2023-04-21 04:42 Quote from: Handoko on April 21, 2023, 06:11:26 amOf course I had read the pdf before I started the questions here. For doing Firebird Embedded version 3 and 4 on Windows, they are relatively easy. After  some research on the Internet and testing, I managed to find out the minimum files needed for Firebird Embedded but for Windows only. If anyone interested, the see the attached picture. I always write and save the information if I found something useful. QuoteEmbedded in Firebird 3 Everything you need for deploying Firebird 3 embedded with your application is present in the .zip (Windows) or .tar.gz (Linux) kit that you download from the Firebird website. We'll work with mainly with the Windows zip kit here, but the principle is the same for the Linux kit: unzip the Windows kit into its own folder or decompress and untar the Linux one into its own directory. There are differences between structures of the file systems now, specifically in the location of the binary files: Linux retains them in the /bin directory beneath the Firebird root, whereas Windows has them all directly in the Firebird root. The pdf tutorial in the link you gave is for Windows - as I quoted above - it says the principle is the same for Linux. But no, it didn't work on my test. And, the information on the first link is not applicable on Firebird 3 Linux because the mentioned files libfbembed.so and libgds* are no where to be found. If you read the release notes for version 3: https://firebirdsql.org/f ile/documentation/release_notes/html/en/3_0/rlsnotes30.html#rnfb30- engine Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Unification of the Firebird executable is complete With the completion of true SMP support for Superserver, the Firebird core is now a unified library that supports a single ODS, loadable either as an embedded engine or by the “network listener” executable. Choice of server model is determined by settings for a new configuration parameter ServerMode, defining the locking and cache modes. It is specified at global level in firebird.conf. ... When does not contain a network protocol but just the database name, the Remote provider rejects it, and the Engine12 provider comes to the fore and tries to open the named database file. If it succeeds, we get an embedded connection to the database. A special “embedded library” is no longer required. To make the embedded connection, the standard client loads the appropriate provider and becomes an embedded server.  So there is no libfbembed.so for firebird 3. ---------------------------------------------------------------------- Handoko · 2023-04-21 04:51 I also had read that information. As I said most of the information about Firebird Embedded Linux is written for version below 3. Thank you for trying to help. Lets wait for maybe 1 or 2 weeks and see if anyone really managed to do Firebird Embedded version 3 or above on Linux. ---------------------------------------------------------------------- dsiders · 2023-04-21 04:55 Quote from: Handoko on April 21, 2023, 06:51:28 amI also had read that information. As I said most of the information about Firebird Embedded Linux is written for version below 3. Thank you for trying to help. Lets wait for maybe 1 or 2 weeks and see if anyone really managed to do Firebird Embedded version 3 or above on Linux. If you like. The unasked question is: Did you put the required files from the list above in the application directory? ---------------------------------------------------------------------- Handoko · 2023-04-21 05:12 Yes. I first tried it on Windows. Copying all mentioned files to the application directory (I mean my program folder: Desktop\aRFQ), it worked. But on Linux, it didn't. My program and the fdb file is located in Desktop/fbtest. I copied them to both Desktop/fbtest and Desktop/fbtest/bin, also duplicated libfbclient.so to name it as libfbclient.so.02, libfbclient.so.3.0.5 in those folders and also to the /bin folder. I also did the same thing on libEngine12.so. No luck so far. ---------------------------------------------------------------------- Jurassic Pork · 2023-04-21 06:55 hello, the ibase components of sqldb seem to be obsolète. The last version of Zeos ( 8.0. 0-beta) in development (not the online packager version) seemss to work with firebird 3 and 4. see here for firebird 4 server windows and attachment for firebird 3 embedded on Ubuntu 20.04. You need to replace the sqldb components with the zeos components. ibase include : Quoteibase60.inc : {$MODE objfpc} {$MACRO on} interface {$IFDEF LinkDynamically} uses Dynlibs, sysutils,ctypes; Var   UseEmbeddedFirebird : Boolean = False; {$ELSE} uses Dynlibs,ctypes; {$ENDIF} {$IFDEF Unix}   {$DEFINE extdecl:=cdecl}   const     gdslib = 'libgds.'+sharedsuffix; // Needs completion ?     libfc  = 'libfbclient.'+sharedsuffix;     libem  = 'libfbembed.'+sharedsuffix;     v2  = {$ifndef darwin}'.2'{$else}''{$endif};     v21 = {$ifndef darwin}'.2.1'{$else}''{$endif};     v25 = {$ifndef darwin}'.2.5'{$else}''{$endif};     v251 = {$ifndef darwin}'.2.5.1'{$else}''{$endif};     fbclib2      = libfc+v2;     fbembedlib2  = libem+v2;     fbclib21     = libfc+v21;     fbembedlib21 = libem+v21;     fbclib25     = libfc+v25;     fbembedlib25 = libem+v25;     fbclib251    = libfc+v251;     fbembedlib251 = libem+v25;     // Set default here     fbclib       = fbclib251;     fbembedlib   = fbembedlib251; {$ENDIF} Friendly, J.P ---------------------------------------------------------------------- DomingoGP · 2023-04-21 14:33 Have you tried to set the environment vars: Quote# tell dynamic loader where to find embedded lib: LD_LIBRARY_PATH=/home/pascaldev/embed/firebird # tell server where to find files (messages, config etc) FIREBIRD=. #or use absolute path: /home/pascaldev/embed as wiki page says  https://wiki.freepascal.org/Firebird_embedded Sorry, don't tested, I don't have any Linux installed to test. ---------------------------------------------------------------------- rvk · 2023-04-21 19:29 Quote from: Handoko on April 21, 2023, 07:12:04 amBut on Linux, it didn't. My program and the fdb file is located in Desktop/fbtest. I copied them to both Desktop/fbtest and Desktop/fbtest/bin, also duplicated libfbclient.so to name it as libfbclient.so.02, libfbclient.so.3.0.5 in those folders and also to the /bin folder. I also did the same thing on libEngine12.so. No luck so far. You might have had more luck asking this on the Firebird forum. But I took a stab at it...  The reason why it didn't work for you could be seen by examining libfbclient.so.3.0.10.so with lddtree (from pax-utils). (try it and see what you are missing if it still doesn't work) 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 $ sudo apt install pax-utils$ lddtree lib/libfbclient.so.3.0.10libgds.so => ./libgds.so (interpreter => none)    librt.so.1 => /lib/x86_64-linux- gnu/librt.so.1    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2    libncurses.so.5 => not found    libtommath.so.0 => not found    libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6    libgcc_s.so.1 => /lib/x86_64-linux- gnu/libgcc_s.so.1    libpthread.so.0 => /lib/x86_64-linux- gnu/libpthread.so.0    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6  ld-linux-x86-64.so.2 => /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 So you will need libncurses5 and libtommath1 libraries too. 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 sudo apt- get install libncurses5 libtommath1 It could be that libtommath1 is already installed. In that case you need to create an extra symlink: 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 sudo ln -s libtommath.so.1 /usr/lib/x86_64-linux-gnu/libtommath.so.0 After that it should work. Also don't forget to set the LD_LIBRARY_PATH accordingly. 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 export LD_LIBRARY_PATH=~/Firebird-3.0.10.33601-0.amd64/opt/firebird/libexport FIREBIRD=~/Firebird-3.0.10.33601-0.amd64/opt/firebird(with Firebird-3.0.10.33601-0.amd64 being the unpacked directory , including the buildroot.tar.gz) Let me know if it doesn't work and I can see if I missed something. ~~ I tested this with a clean Ubuntu 22.04 version. Here is the complete script I followed: 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 # ---------# download and unpack firebird embedded# ---------wget https: //github.com/FirebirdSQL/firebird/releases/download/v3.0.10/Firebird- 3.0.10.33601-0.amd64.tar.gztar -xf Firebird-3.0.10.33601-0.amd64.tar.gzcd Firebird-3.0.10.33601-0.amd64tar -xf buildroot.tar.gzcd opt/firebird # ---------# check dependencies# ---------sudo apt install pax- utilslddtree lib/libfbclient.so.3.0.10 # ---------# install dependencies for firebird embedded ("not found")# ---------sudo apt- get install libncurses5 libtommath1sudo ln -s libtommath.so.1 /usr/lib/x86_64-linux-gnu/libtommath.so.0 # ---------# install fpc, set environment and test. fpc only needed for compilation# ---------sudo apt-get install fpcexport LD_LIBRARY_PATH=~/Firebird-3.0.10.33601-0.amd64/opt/firebird/libexport FIREBIRD=/home/rik/Firebird-3.0.10.33601-0.amd64/opt/firebirdnano test.ppfpc -MObjFPC test.pp./test Result: Quotea b c done test.pp looks like this: 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 testfirebird;uses SQLDB, DB, IBConnection;var  FB: TIBConnection;  SQL: TSQLQuery;begin  FB := TIBConnection.Create(nil);  SQL := TSQLQuery.Create(FB);  try    FB.Transaction := TSQLTransaction.Create(FB);    FB.Transaction.Database := FB;    FB.LoginPrompt := False;    // FB.HostName := 'localhost';    FB.DatabaseName := 'DEMO.FDB';    FB.UserName := 'SYSDBA';    FB.Password := 'masterkey';    try      FB.Connected := True;    except      on E: EDatabaseError do      begin        FB.CreateDB;      FB.Connected := True;        writeln('creating DEMO.FBD');        FB.ExecuteDirect('CREATE TABLE TEST(ID BIGINT, CODE VARCHAR(80));');      if FB.Transaction.Active then FB.Transaction.Commit;        FB.ExecuteDirect('INSERT INTO TEST VALUES(1, ''a'');');        FB.ExecuteDirect('INSERT INTO TEST VALUES(2, ''b'');');        FB.ExecuteDirect('INSERT INTO TEST VALUES(3, ''c'');');        if FB.Transaction.Active then FB.Transaction.Commit;      end;    end;  SQL := TSQLQuery.Create(FB);    SQL.Database := FB;    SQL.Transaction := FB.Transaction;    SQL.SQL.Text := 'SELECT * FROM TEST';    SQL.Open;    while not SQL.EOF do    begin      writeln(SQL.FieldByName('CODE').asString);      SQL.Next;    end;    SQL.Close;  finally    FB.Free;  end;  writeln('done');  readln;end. BTW There is no need for a symlink or something because the tar already contains a symlink for libfbclient.so to the correct version. So this should work 'out of the box'. Also... if you need to keep the current LD_LIBRARY_PATH then you should do: 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 export LD_L IBRARY_PATH=$LD_LIBRARY_PATH:/path/to/firebird_embedded/opt/firebird/l ibYou can also add it to your ~/.bashrc: 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 echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/firebird_embedded/op t/firebird/lib' >> ~/.bashrc Quote from: Handoko on April 20, 2023, 09:27:53 pmQuote from: Thaddy on July 06, 2022, 06:54:25 pmJust do not use Firebird. I didn't believe it but it seems I now have to agree with Thaddy. Someone, please prove me wrong! Hope your faith is restored after this ---------------------------------------------------------------------- Slyde · 2023-04-22 23:23 Hi, Handoko.  I've been using SQLite/SQLite3 in my desktop apps, both in Object Pascal and C++, for years and can attest to it being rock solid.  Too many hoops to jump through when I tried using Firebird.  SQLite3 works right out of the box here on Lazarus (Linux Mint), and all you need for windows is a single sqlite3.dll.  Here's a small list of companies across the world that use it, too.  Hard to go wrong with SQLite3. ---------------------------------------------------------------------- SymbolicFrank · 2023-04-24 07:54 SQLite is a joy to use, compared to most other SQL servers. Yes, you have to be careful with the format of things like DateTime and there are no user-defined functions, but then again: it integrates seamlessly with your application and is very fast. On the other hand, most of the extra functionality the big SQL database servers offer is because much of the things you would do in code with SQLite, you have to run on the server instead. SQL wasn't created to write functions and such, so the syntax used to do so is a bit strange, and different for each brand. So, it mostly depends on what you want to do. The good thing about Firebird is that there are a lot of tools to help you when things go wrong, but compatibility and development speed are not the highlights. So you might need them. ---------------------------------------------------------------------- Zvoni · 2023-04-24 08:06 I have to disagree with some points QuoteSQLite is a joy to use, compared to most other SQL servers.SQLite is NOT a SQL server. Period! You cannot "compare" SQLite to, say, MS SQL-Server QuoteYes, you have to be careful with the format of things like DateTimeNo, you don't have to be "careful". You have to be consistent. Quote... and there are no user-defined functions, ....There are. They are called "Extensions" QuoteOn the other hand, most of the extra functionality the big SQL database servers offer is because much of the things you would do in code with SQLite, you have to run on the server instead. No, you don't HAVE to run them on the Server ---------------------------------------------------------------------- Handoko · 2023-04-25 10:10 Thank you all for the replies. No luck so far. I tested all your suggestions, except using Zeos as suggested by Jurassic Pork. I will do it later. After reading rvk reply, I found one of the possible causes was library version problem (in Windows, they call it DLL hell). So I created a new virtual machine: Ubuntu 23.04 and made sure there was no library dependency issue. See the attached picture. I followed rvk solution. But I couldn't do it exactly, because I intentionally trying to compiled and used it on different OSes to see how portable it will be. The Firebird I used (when compiling the test program) was version 3.0.5. Not from buildroot.tar.gz, but from my computer because I have Firebird installed on it. The screenshot shows the error I got. So I duplicated the libfbclient.so.3.0.5 to name it as libfbclient.so.2.5.1. The program, data and library folder was /home/ubuntu/Desktop/fbtest. And as you can see I already done the export correctly, and the lddtree not showing any issue. I already wrote a short program to test. It works on my system. And if I set the hostname empty and make it to use FB embedded (providing libEngine12 and the libfbclient), it still working good on my system because it has Firebird installed. But I cannot make FB embedded works on other systems, unless I install Firebird on that system. I will later try Zeos. If I still can't make it works I might use SQLite. I have done research on SQLite. It has many disadvantages. But if I really have to use it, I will be careful and consistent to minimize the possible problems. ---------------------------------------------------------------------- Jurassic Pork · 2023-04-25 10:38 Hello, Quote from: Handoko on April 25, 2023, 12:10:32 pm The screenshot shows the error I got. So I duplicated the libfbclient.so.3.0.5 to name it as libfbclient.so.2.5.1. see my reply #12 : the free pascal include file ibase60.inc is not up to date. And you can use a symbolic link unstead of duplicate the file. Friendly, J.P ---------------------------------------------------------------------- Handoko · 2023-04-25 10:47 Thank you, I will try your solution later. But I think I found the problem. See the screenshot. It is clear, libEngine12.so requires to have libfbclient.so.2 to be installed or exist on certain location. Any suggestion how to solve the issue? Don't tell me to copy the file to lib folder. If I decided to use embedded, it means I want to write a portable program, no need to install, no sudo needed. Just copy and run. ---------------------------------------------------------------------- rvk · 2023-04-25 11:04 Quote from: Handoko on April 25, 2023, 12:10:32 pmI followed rvk solution. But I couldn't do it exactly, because I intentionally trying to compiled and used it on different OSes to see how portable it will be. The Firebird I used (when compiling the test program) was version 3.0.5. Not from buildroot.tar.gz, but from my computer because I have Firebird installed on it. The screenshot shows the error I got. So I duplicated the libfbclient.so.3.0.5 to name it as libfbclient.so.2.5.1.You didn't create a firebird.conf containing where the libEngine12.so can be found. Further... Linux DOESN'T search the current executable directory for .so files !!! So you can't just copy the .so file there and hope it works. You NEED to set the LD_LIBRARY_PATH environment variable like I showed. (You can point it to the same directory as the executable if you don't want the directory structure) I've copied the following files to ~/testdir: libEngine12.so libfbclient.so # <- just a copy of libfbclient.so.3.0.10 libib_util.so test # <- my executable I set export LD_LIBRARY_PATH=~/testdir And ran the program. It loaded the libfbclient.so (but now gave me a "localhost" error). But it did load the embedded firebird. I have to figure out what I missed because the libfbclient.so now thinks it isn't embedded (because of the localhost error). That's why I began copying the complete directory structure. That does work as embedded. ---------------------------------------------------------------------- rvk · 2023-04-25 11:17 Ok. I have the embedded files. For now... you NEED to put the libEngine12.so into a plugins directory. So ~/testdir : plugins/libEngine12.so libfbclient.so # <- just a copy of libfbclient.so.3.0.10 libib_util.so test # <- my executable export LD_LIBRARY_PATH=~/testdir export FIREBIRD=~/testdir That should work. BTW. It's also mentioned here: https://wiki.freepascal.org/Firebird_embedded#Linux ---------------------------------------------------------------------- cdbc · 2023-04-25 12:35 Hi Found this on the interweb: https://www.ibphoenix.com/files/Embedded_fb3.pdf Regards Benny ---------------------------------------------------------------------- Handoko · 2023-04-26 06:47 @cdbc Thank you cdbc. Unfortunately that pdf explains how to do it on Windows, and it says the principle is the same for Linux. Doing Firebird embedded for Windows is easy but I am having problem for doing it on Linux. @rvk Thank you for your persistence to help. I made some progress but still have problem. It said: Unable to complete network request to host "local host". I followed your instructions. - libEngine12.so was in both the executable directory and plugins - libfbclient.so and libib_util.so are in the executable directory - Set the export variables - Set the firebird.conf accordingly I found that the Firebird 3 embedded (or my project1) requires canberra-gtk module. So I had the module installed. This is my code for the connection: 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 procedure FBSetConnection(Connection: TIBConnection);begin  if not(Assigned(Connection)) then Exit;  with Connection do  begin//    HostName     := 'Localhost';    // remove for serverless    HostName   := '';    DatabaseName := GlobalDatabase;    UserName     := 'SYSDBA';    Password     := 'masterkey';    CharSet      := 'UTF8';  end;end; Any idea? ---------------------------------------------------------------------- rvk · 2023-04-26 07:01 Quote from: Handoko on April 26, 2023, 08:47:28 amThank you for your persistence to help. I made some progress but still have problem. It said: Unable to complete network request to host "local host".Yes, I had that initially too. Quote from: Handoko on April 26, 2023, 08:47:28 amI followed your instructions. - libEngine12.so was in both the executable directory and pluginslibEngine12.so NEEDS to be in the directory pointed by FIREBIRD and then in the subdirectory plugins. (no need for a copy in the executable directory itself) Quote from: Handoko on April 26, 2023, 08:47:28 am- Set the firebird.conf accordinglyIf you point the FIREBIRD environment variable to the directory where libfbclient.so is (with the libEngine12.so in the plugins directory) then you don't actually need the firebird.conf. Quote from: Handoko on April 26, 2023, 08:47:28 amI found that the Firebird 3 embedded (or my project1) requires canberra-gtk module. So I had the module installed. That one already was preinstalled on my Ubuntu: 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 rik@rik- Virtual-Machine:~$ dpkg -l | grep canberraii  gnome-session-canberra                   0.30-10ubuntu1                          amd64        GNOME session log in and log out sound eventsii  libcanberra- gtk3-0:amd64                   0.30-10ubuntu1                          amd64        GTK+ 3.0 helper for playing widget event sounds with libcanberraii  libcanberra-gtk3-module:amd64              0.30-10ubuntu1                          amd64        translates GTK3 widgets signals to event soundsii  libcanberra-pulse:amd64                  0.30-10ubuntu1                          amd64        PulseAudio backend for libcanberraii  libcanberra0:amd64                         0.30-10ubuntu1                          amd64        simple abstract interface for playing event soundsIt's probably needed by one of the other dependencies (or is loaded dynamically) because lddtree doesn't list it. I get the localhost error when FIREBIRD isn't set correctly. Can you check with echo $FIREBIRD if it is set correctly? And echo $LD_LIBRARY_PATH (but that one seems to be correct otherwise you wouldn't get the localhost error). I had this (in a testdirectory /home/rik/d 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 rik@rik- Virtual-Machine:~/d$ ./testAn unhandled exception occurred at $00000000004F6C05:EInOutError: Can not load default Firebird clients ("libfbclient.so.2.5.1" or "libgds.so" or "libfbembed.so.2.5"). Check your installation.  $00000000004F6C05  $000000000044C8C9 rik@rik- Virtual-Machine:~/d$ export LD_LIBRARY_PATH=~/drik@rik-Virtual- Machine:~/d$ ./testAn unhandled exception occurred at $000000000044BA77:EIBDatabaseError: TIBConnection : CreateDB : -Unable to complete network request to host "localhost". -Failed to establish a connection.  $000000000044BA77  $000000000044C84F rik@rik-Virtual- Machine:~/d$ export FIREBIRD=~/drik@rik-Virtual-Machine:~/d$ ./testabcdone This is my directory structure: 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 rik@rik- Virtual-Machine:~/d$ ls -ltrR.:total 4840-rwxrwxr-x 1 rik rik 1513064 apr 25 12:58 test-rwxr-xr-x 1 rik rik 1911800 apr 25 13:08 libfbclient.so-rwxr-xr-x 1 rik rik    4368 apr 25 13:08 libib_util.sodrwxrwxr-x 2 rik rik    4096 apr 25 13:12 plugins-rw- rw---- 1 rik rik 1515520 apr 25 13:17 DEMO.FDB ./plugins:total 7336-rwxr-xr-x 1 rik rik 7511904 apr 25 13:07 libEngine12.so I'm not even sure libib_util.so is really needed because I can delete it without any problems. It might be needed for certain functions (not done in my testprogram). (The description of it is "Firebird RDBMS UDF support library" so you'll need it for UDF support) Edit: I see you did create the FIREBIRD environment variable. What is your ls -ltrR result? Are the permissions of plugins set correctly? And remove the firebird.conf because I'm not sure if you can use ~ there (for home directory). It might throw everything off (and you don't need the firebird.conf if you didn't change anything else). ---------------------------------------------------------------------- Handoko · 2023-04-26 11:01 I believe now I have done what you said, what's next? ---------------------------------------------------------------------- rvk · 2023-04-26 11:20 Quote from: Handoko on April 26, 2023, 01:01:11 pmI believe now I have done what you said, what's next? Weird. I thought it might have been the permission but after setting the same permissions here, it still works. Did you set the TIBConnection.Connected property to false in the IDE (not that the program tries to connect before the actual start). (You can also set a Showmessage() at the top of the FBSetConnection function to see if the error comes before setting the connection params). What version of Firebird is that? The filesize differ from mine. I have downloaded Firebird-3.0.10.33601-0.amd64.tar.gz. (libib_util.so was temporarily removed but that shouldn't be the problem) 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 rik@rik- Virtual-Machine:~/d$ ls -ltrR.:total 4836-rwxrwxr-x 1 rik rik 1513064 apr 25 12:58 test-rw-r--r-- 1 rik rik 1911800 apr 25 13:08 libfbclient.sodrwxr-xr-x 2 rik rik    4096 apr 25 13:12 plugins-rw- rw-r-- 1 rik rik    1690 apr 26 13:12 firebird.log-rw-r--r-- 1 rik rik 1515520 apr 26 13:12 DEMO.FDB ./plugins:total 7336-rw-r--r-- 1 rik rik 7511904 apr 25 13:07 libEngine12.sorik@rik-Virtual-Machine:~/d$ echo $FIREBIRD/home/rik/drik@rik-Virtual-Machine:~/d$ echo $LD_LIBRARY_PATH/home/rik/drik@rik-Virtual-Machine:~/d$ (trying a complete new clean install now...) ---------------------------------------------------------------------- rvk · 2023-04-26 11:40 Ok, my complete log on a clean Ubuntu 22.04. 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 rik@rik- Virtual-Machine:~$ wget https://github.com/FirebirdSQL/firebird/releas es/download/v3.0.10/Firebird-3.0.10.33601-0.amd64.tar.gz--2023-04-26 13:35:53--  https://github.com/FirebirdSQL/firebird/releases/download/ v3.0.10/Firebird-3.0.10.33601-0.amd64.tar.gzResolving github.com (github.com)... 140.82.121.4Connecting to github.com (github.com)|140.82.121.4|:443... connected.HTTP request sent, awaiting response... 302 FoundLocation: https://objects.githubusercontent.com/github-production-release- asset-2e65be/54005538/34b37706-63ea-496f-b3dc-6781bd46e43c?X-Amz- Algorithm=AWS4-HMAC-SHA256&X-Amz- Credential=AKIAIWNJYAX4CSVEH53A%2F20230426%2Fus- east-1%2Fs3%2Faws4_request&X-Amz-Date=20230426T113553Z&X-Amz- Expires=300&X-Amz-Signature=c2d6fbe1a3e832971aa1e839e764b1ac9ebdde3121 672a1229c4512bbef09dff&X-Amz- SignedHeaders=host&actor_id=0&key_id=0&repo_id=54005538&response- content-disposition=attachment%3B%20filename%3DFirebird-3.0.10.33601- 0.amd64.tar.gz&response-content-type=application%2Foctet-stream [following]--2023-04-26 13:35:53--  https://objects.githubusercontent.com/github-production-release- asset-2e65be/54005538/34b37706-63ea-496f-b3dc-6781bd46e43c?X-Amz- Algorithm=AWS4-HMAC-SHA256&X-Amz- Credential=AKIAIWNJYAX4CSVEH53A%2F20230426%2Fus- east-1%2Fs3%2Faws4_request&X-Amz-Date=20230426T113553Z&X-Amz- Expires=300&X-Amz-Signature=c2d6fbe1a3e832971aa1e839e764b1ac9ebdde3121 672a1229c4512bbef09dff&X-Amz- SignedHeaders=host&actor_id=0&key_id=0&repo_id=54005538&response- content-disposition=attachment%3B%20filename%3DFirebird-3.0.10.33601- 0.amd64.tar.gz&response-content-type=application%2Foctet- streamResolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.110.133, 185.199.111.133, 185.199.108.133, ...Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443... connected.HTTP request sent, awaiting response... 200 OKLength: 8768068 (8,4M) [application/octet-stream]Saving to: ‘Firebird-3.0.10.33601- 0.amd64.tar.gz’ Firebird-3.0.10.33601-0.amd64.tar.gz          100%[=== ====================================================================== =======================>]   8,36M  36,9MB/s    in 0,2s 2023-04-26 13:35:54 (36,9 MB/s) - ‘Firebird-3.0.10.33601-0.amd64.tar.gz’ saved [8768068/8768068] rik@rik-Virtual-Machine:~$ tar -xf Firebird-3.0.10.33601-0.amd64.tar.gzrik@rik-Virtual-Machine:~$ cd Firebird-3.0.10.33601-0.amd64rik@rik-Virtual- Machine:~/Firebird-3.0.10.33601-0.amd64$ tar -xf buildroot.tar.gzrik@rik-Virtual- Machine:~/Firebird-3.0.10.33601-0.amd64$ cd ..rik@rik-Virtual- Machine:~$ mkdir drik@rik-Virtual-Machine:~$ cd drik@rik-Virtual- Machine:~/d$ export LD_LIBRARY_PATH=~/drik@rik-Virtual-Machine:~/d$ export FIREBIRD=~/drik@rik-Virtual-Machine:~/d$ scp rik@192.168.2.96:/home/rik/d/test .The authenticity of host '192.168.2.96 (192.168.2.96)' can't be established.ED25519 key fingerprint is SHA256:.This key is not known by any other namesAre you sure you want to continue connecting (yes/no/[fingerprint])? yesWarning: Permanently added '192.168.2.96' (ED25519) to the list of known hosts.rik@192.168.2.96's password:test                                                                                                                                           100% 1478KB 112.7MB/s   00:00rik@rik-Virtual-Machine:~/d$ cp ~/Firebird-3.0.10.33601-0.amd64/opt/firebird/lib/libfbclient.so .rik@rik-Virtual-Machine:~/d$ cp ~/Firebird-3.0.10.33601-0.amd64/opt/firebird/lib/libib_util.so .rik@rik-Virtual-Machine:~/d$ mkdir pluginsrik@rik-Virtual- Machine:~/d$ cp ~/Firebird-3.0.10.33601-0.amd64/opt/firebird/plugins/libEngine12.so pluginsrik@rik-Virtual-Machine:~/d$ ls -lR.:total 3360-rwxr-xr-x 1 rik rik 1911800 apr 26 13:36 libfbclient.so-rwxr-xr-x 1 rik rik    4368 apr 26 13:37 libib_util.sodrwxrwxr-x 2 rik rik    4096 apr 26 13:37 plugins-rwx------ 1 rik rik 1513064 apr 26 13:36 test ./plugins:total 7336-rwxr-xr-x 1 rik rik 7511904 apr 26 13:37 libEngine12.sorik@rik- Virtual-Machine:~/d$ ./testAn unhandled exception occurred at $00000000004F6C05:EInOutError: Can not load default Firebird clients ("libfbclient.so.2.5.1" or "libgds.so" or "libfbembed.so.2.5"). Check your installation.  $00000000004F6C05  $000000000044C8C9 rik@rik- Virtual-Machine:~/d$ sudo apt-get install libncurses5 libtommath1[sudo] password for rik:Reading package lists... DoneBuilding dependency tree... DoneReading state information... DoneThe following additional packages will be installed:  libtinfo5The following NEW packages will be installed:  libncurses5 libtinfo5 libtommath10 upgraded, 3 newly installed, 0 to remove and 116 not upgraded.Need to get 263 kB of archives.After this operation, 1.034 kB of additional disk space will be used.Do you want to continue? [Y/n] yGet:1 http://nl.archive.ubuntu.com/ubuntu jammy/universe amd64 libtinfo5 amd64 6.3-2 [99,2 kB]Get:2 http://nl.archive.ubuntu.com/ubuntu jammy/universe amd64 libncurses5 amd64 6.3-2 [107 kB]Get:3 http://nl.archive.ubuntu.com/ubuntu jammy/main amd64 libtommath1 amd64 1.2.0-6build3 [56,5 kB]Fetched 263 kB in 0s (787 kB/s)Selecting previously unselected package libtinfo5:amd64.(Reading database ... 178817 files and directories currently installed.)Preparing to unpack .../libtinfo5_6.3-2_amd64.deb ...Unpacking libtinfo5:amd64 (6.3-2) ...Selecting previously unselected package libncurses5:amd64.Preparing to unpack .../libncurses5_6.3-2_amd64.deb ...Unpacking libncurses5:amd64 (6.3-2) ...Selecting previously unselected package libtommath1:amd64.Preparing to unpack .../libtommath1_1.2.0-6build3_amd64.deb ...Unpacking libtommath1:amd64 (1.2.0-6build3) ...Setting up libtommath1:amd64 (1.2.0-6build3) ...Setting up libtinfo5:amd64 (6.3-2) ...Setting up libncurses5:amd64 (6.3-2) ...Processing triggers for libc-bin (2.35-0ubuntu3.1) ...rik@rik-Virtual-Machine:~/d$ sudo ln -s libtommath.so.1 /usr/lib/x86_64-linux-gnu/libtommath.so.0rik@rik- Virtual-Machine:~/d$ ./testcreating DEMO.FBDabcdone rik@rik-Virtual- Machine:~/d$  Works... Can you test my small test program from this post (program testfirebird)? https://forum.lazarus.freepascal.org/index.php/topic,63142.msg477919.h tml#msg477919 (just to make sure it's not in your program) ---------------------------------------------------------------------- Handoko · 2023-04-26 13:08 @rvk I copied and compiled your code testfirebird from the post #14 using my Lazarus 2.3.0 Ubuntu Mate 19.10 64-bit Firebird 3.0.5.Then copied the testfirebird binary to the virtual machine and set the file as executable.The virtual machine was Ubuntu 23.10 64-bit freshly installed 2 days ago.The virtual machine did not have Firebird server installed.I installed pax-utils, libncurses, libtommath, canberra-gtk on the virtual machine.The libEngine12, libib_util, libfbclient in the virtual machine were copied from the host machine.So those lib files were version 3.0.5.See the screenshot1 below for the run result.@Jurassic Pork I tried your suggestion to use Zeos but I can't find TZTransaction component, where to get it? My system is Ubuntu Mate 19.10 64-bit, Lazarus 2.3.0 manually built from the sources. I installed the Zeos 7.2.14 using Online Package Manager. See the screenshot2 below. ---------------------------------------------------------------------- rvk · 2023-04-26 13:28 Quote from: Handoko on April 26, 2023, 03:08:54 pm   See the screenshot1 below for the run result.I assume your program and the Firebird libraries are all 64 bit? Can you try it with the 3.0.10 version: 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 cd ~wget ht tps://github.com/FirebirdSQL/firebird/releases/download/v3.0.10/Firebi rd-3.0.10.33601-0.amd64.tar.gztar -xf Firebird-3.0.10.33601-0.amd64.tar.gzcd Firebird-3.0.10.33601-0.amd64tar -xf buildroot.tar.gzcd ~/Desktop/fbtestcp ~/Firebird-3.0.10.33601-0.amd64/opt/firebird/lib/libfbclient.so .cp ~/Firebird-3.0.10.33601-0.amd64/opt/firebird/lib/libib_util.so .cp ~/Firebird-3.0.10.33601-0.amd64/opt/firebird/plugins/libEngine12.so pluginsexport LD_LIBRARY_PATH=~/Desktop/fbtestexport FIREBIRD=~/Desktop/fbtest./testfirebird (In that case the permissions are also kept the same as in the tar.gz.) (I also tried a subdirectory on the Desktop) 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 rik@rik- Virtual-Machine:~$ cd ~/Desktoprik@rik-Virtual-Machine:~/Desktop$ mkdir fbtestrik@rik-Virtual-Machine:~/Desktop$ cd ~/Desktop/fbtestrik@rik-Virtual-Machine:~/Desktop/fbtest$ mkdir pluginsrik@rik-Virtual-Machine:~/Desktop/fbtest$ scp rik@192.168.2.96:/home/rik/d/test .rik@192.168.2.96`s password:test                                                                                                                                             100% 1478KB 129.7MB/s   00:00rik@rik-Virtual-Machine:~/Desktop/fbtest$ cp ~/Firebird-3.0.10.33601-0.amd64/opt/firebird/lib/libfbclient.so .rik@rik-Virtual-Machine:~/Desktop/fbtest$ cp ~/Firebird-3.0.10.33601-0.amd64/opt/firebird/lib/libib_util.so .rik@rik-Virtual-Machine:~/Desktop/fbtest$ cp ~/Firebird-3.0.10.33601-0.amd64/opt/firebird/plugins/libEngine12.so pluginsrik@rik-Virtual-Machine:~/Desktop/fbtest$ ls -lR.:total 3360-rwxr-xr-x 1 rik rik 1911800 apr 26 15:26 libfbclient.so-rwxr-xr-x 1 rik rik    4368 apr 26 15:26 libib_util.sodrwxrwxr-x 2 rik rik    4096 apr 26 15:26 plugins-rwx------ 1 rik rik 1513064 apr 26 15:26 test ./plugins:total 7336-rwxr-xr-x 1 rik rik 7511904 apr 26 15:26 libEngine12.sorik@rik-Virtual-Machine:~/Desktop/fbtest$ export LD_LIBRARY_PATH=~/Desktop/fbtestrik@rik-Virtual- Machine:~/Desktop/fbtest$ export FIREBIRD=~/Desktop/fbtestrik@rik- Virtual-Machine:~/Desktop/fbtest$ ./testcreating DEMO.FBDabcdone rik@rik-Virtual-Machine:~/Desktop/fbtest$ echo $FIREBIRD/home/rik/Desktop/fbtestrik@rik-Virtual- Machine:~/Desktop/fbtest$ echo $LD_LIBRARY_PATH/home/rik/Desktop/fbtestrik@rik-Virtual- Machine:~/Desktop/fbtest$ ---------------------------------------------------------------------- rvk · 2023-04-26 13:54 BTW. Your libib_util.so seems very large. Mine is only 4368 bytes. I downloaded 3.0.5.33220 and that one also works (and has a smaller libib_util.so than yours). 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 rik@rik- Virtual-Machine:~/Desktop/fbtest$ cd ~rik@rik-Virtual-Machine:~$ wget https://github.com/FirebirdSQL/firebird/releases/download/R3_0_5/Fireb ird-3.0.5.33220-0.amd64.tar.gz2023-04-26 15:50:07 (34,7 MB/s) - ‘Firebird-3.0.5.33220-0.amd64.tar.gz’ saved [8561290/8561290] rik@rik- Virtual-Machine:~$ tar -xf Firebird-3.0.5.33220-0.amd64.tar.gzrik@rik- Virtual-Machine:~$ cd Firebird-3.0.5.33220-0.amd64/rik@rik-Virtual- Machine:~/Firebird-3.0.5.33220-0.amd64$ tar -xf buildroot.tar.gzrik@rik-Virtual- Machine:~/Firebird-3.0.5.33220-0.amd64$ cd ~/Desktop/fbtest/rik@rik- Virtual-Machine:~/Desktop/fbtest$ cp ~/Firebird-3.0.5.33220-0.amd64/opt/firebird/lib/libfbclient.so .rik@rik-Virtual-Machine:~/Desktop/fbtest$ cp ~/Firebird-3.0.5.33220-0.amd64/opt/firebird/lib/libib_util.so .rik@rik-Virtual-Machine:~/Desktop/fbtest$ cp ~/Firebird-3.0.5.33220-0.amd64/opt/firebird/plugins/libEngine12.so pluginsrik@rik-Virtual-Machine:~/Desktop/fbtest$ export LD_LIBRARY_PATH=~/Desktop/fbtestrik@rik-Virtual- Machine:~/Desktop/fbtest$ export FIREBIRD=~/Desktop/fbtestrik@rik- Virtual-Machine:~/Desktop/fbtest$ ./testabcdone rik@rik-Virtual- Machine:~/Desktop/fbtest$ ls -lR.:total 4824-rw-rw---- 1 rik rik 1515520 apr 26 15:51 DEMO.FDB-rwxr-xr-x 1 rik rik 1895096 apr 26 15:51 libfbclient.so-rwxr-xr-x 1 rik rik    4368 apr 26 15:51 libib_util.sodrwxrwxr-x 2 rik rik    4096 apr 26 15:26 plugins- rwx------ 1 rik rik 1513064 apr 26 15:26 test ./plugins:total 7236-rwxr-xr-x 1 rik rik 7408160 apr 26 15:51 libEngine12.sorik@rik- Virtual-Machine:~/Desktop/fbtest$ And unsetting FIREBIRD gives the same error for me. 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 rik@rik- Virtual-Machine:~/Desktop/fbtest$ unset FIREBIRDrik@rik-Virtual- Machine:~/Desktop/fbtest$ ./testAn unhandled exception occurred at $000000000044BA77:EIBDatabaseError: TIBConnection : CreateDB : -Unable to complete network request to host "localhost". -Failed to establish a connection.  $000000000044BA77  $000000000044C84F rik@rik-Virtual- Machine:~/Desktop/fbtest$ export FIREBIRD=~/Desktop/fbtestrik@rik- Virtual-Machine:~/Desktop/fbtest$ ./testabcdone rik@rik-Virtual- Machine:~/Desktop/fbtest$ ---------------------------------------------------------------------- Handoko · 2023-04-27 05:20 I followed your instructions trying both version 3.0.10.33601 and 3.0.5.33220, but both gave the same error. See screenshot1. After inspection I found libfbclient had 2 missing requirements: libncurses5 version5 and libtommath version0. The virtual machine (Ubuntu 23.04 64-bit) had libncurses6 and libtommath1 installed. I could instal libncurses5 easily but libtommath version 0 was no where to be found in the Ubuntu repository, I used Synaptic Package Manager. See screenshot2. I checked the libfbclient copied from the host computer, no dependency issue. It used libtommath version 1. See screenshot3. Quote from: rvk on April 26, 2023, 03:28:37 pmI assume your program and the Firebird libraries are all 64 bit? I am not sure. The Firebird on the host computer (Ubuntu Mate 19.10 64-bit) was installed using my Ubuntu default repository using Synaptic Package Manager. See screenshot4. I haven't tested much but it seems working good if my program runs using server-client connection. Quote from: rvk on April 26, 2023, 03:54:44 pmBTW. Your libib_util.so seems very large. Mine is only 4368 bytes. I also had tried to combine: - libfbclient and libEngine12 from the host computer, version 3.0.5.33100 from Ubuntu repository - libib_util version 3.0.5.33220 downloaded from your recommendation Still error but got different error message, see screenshot5. Did you think that was bitness issue? How to check the bitness of the libraries copied from the host computer? ---------------------------------------------------------------------- Handoko · 2023-04-27 05:20 Screenshot5 ---------------------------------------------------------------------- rvk · 2023-04-27 05:32 Quote from: Handoko on April 27, 2023, 07:20:20 amAfter inspection I found libfbclient had 2 missing requirements: libncurses5 version5 and libtommath version0. The virtual machine (Ubuntu 23.04 64-bit) had libncurses6 and libtommath1 installed. I could instal libncurses5 easily but libtommath version 0 was no where to be found in the Ubuntu repository, I used Synaptic Package Manager. See screenshot2. In my first post where I said to check the dependencies I showed how you needed to create the symlink to libtommath.so.0 with ln. Did you miss that? The installer does that automatically but for embedded you need to do it manually. That's why I showed you all my steps on a very new clean Ubuntu install. You can check bitness with the file command. But then the .so wouldn't load. It would not explain the localhost error unless you are combining different versions. That's also the reason why I asked you to perform the exact steps with downloading 3.0.10 and the exact commands to copy the correct files. I'll check in your screenshots if I can see if you missed some a bit later today. ---------------------------------------------------------------------- rvk · 2023-04-27 05:39 Quote from: Handoko on April 27, 2023, 07:20:49 amScreenshot5 In this screenshot the engine.so has no x permission. So this is not after following my instructions with downloading a clean Firebird.tar.gz and copying the files with my instructions. Here was my complete log on a clean system. Including the fix for libtommath.so.0. https://forum.lazarus.freepascal.org/index.php/topic,63142.msg478363.h tml#msg478363 Try to follow those steps. (From seeing screenshot1 and 2 you were very close, you only needed to do the sudo ln on libtommath.so.0 to make it work there.) ---------------------------------------------------------------------- rvk · 2023-04-27 14:52 Ok. I've now testes multiple versions multiple times. Firebird 3.0.10, 4.0.2 and 5.0 Beta 1. Here are the commands I used on a clean Ubuntu 23.04 (base install) in Hyper-V (each time restored to clean base). All versions worked as embedded without any problems. (Note: for Firebird 4 and higher you also need libtomcrypt1 besides libncurses5 and libtommath1/0.) 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 # ---------# for Firebird 3.0.10# ---------# prepare directoriescd ~mkdir ~/Desktop/fbtestmkdir ~/Desktop/fbtest/plugins# download Firebird embeddedwget https://github.com/FirebirdSQL/firebird/releases /download/v3.0.10/Firebird-3.0.10.33601-0.amd64.tar.gztar -xf Firebird-3.0.10.33601-0.amd64.tar.gzcd Firebird-3.0.10.33601-0.amd64tar -xf buildroot.tar.gz# copying the needed filescd ~/Desktop/fbtestcp ~/Firebird-3.0.10.33601-0.amd64/opt/firebird/lib/libfbclient.so .cp ~/Firebird-3.0.10.33601-0.amd64/opt/firebird/lib/libib_util.so .cp ~/Firebird-3.0.10.33601-0.amd64/opt/firebird/plugins/libEngine12.so pluginsscp rik@192.168.2.96:/home/rik/d/testfirebird .# install dependenciessudo apt-get install libncurses5sudo apt-get install libtommath1sudo ln -s libtommath.so.1 /usr/lib/x86_64-linux- gnu/libtommath.so.0 # we need libtommath0# prepare and executeexport LD_LIBRARY_PATH=~/Desktop/fbtestexport FIREBIRD=~/Desktop/fbtest./testfirebird 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 # ---------# for Firebird 4.0.2# ---------# prepare directoriescd ~mkdir ~/Desktop/fbtestmkdir ~/Desktop/fbtest/plugins# download Firebird embeddedwget https://github.com/FirebirdSQL/firebird/releases/download /v4.0.2/Firebird-4.0.2.2816-0.amd64.tar.gztar -xf Firebird-4.0.2.2816-0.amd64.tar.gzcd Firebird-4.0.2.2816-0.amd64tar -xf buildroot.tar.gz# copying the needed filescd ~/Desktop/fbtestcp ~/Firebird-4.0.2.2816-0.amd64/opt/firebird/lib/libfbclient.so .cp ~/Firebird-4.0.2.2816-0.amd64/opt/firebird/lib/libib_util.so .cp ~/Firebird-4.0.2.2816-0.amd64/opt/firebird/plugins/libEngine13.so pluginsscp rik@192.168.2.96:/home/rik/d/testfirebird .# install dependenciessudo apt-get install libncurses5sudo apt-get install libtommath1sudo apt-get install libtomcrypt1 # extra for Firebird 4.0sudo ln -s libtommath.so.1 /usr/lib/x86_64-linux- gnu/libtommath.so.0 # we need libtommath0# prepare and executeexport LD_LIBRARY_PATH=~/Desktop/fbtestexport FIREBIRD=~/Desktop/fbtest./testfirebird 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 # ---------# for Firebird 5.0.0 Beta 1# ---------# prepare directoriescd ~mkdir ~/Desktop/fbtestmkdir ~/Desktop/fbtest/plugins# download Firebird embeddedwget https://github.com/FirebirdSQL/firebird/releases /download/v5.0.0-Beta1/Firebird-5.0.0.973-Beta1-linux-x64.tar.gztar -xf Firebird-5.0.0.973-Beta1-linux-x64.tar.gzcd Firebird-5.0.0.973-Beta1-linux-x64tar -xf buildroot.tar.gz# copying the needed filescd ~/Desktop/fbtestcp ~/Firebird-5.0.0.973-Beta1-linux-x64/opt/firebird/lib/libfbclient.so .cp ~/Firebird-5.0.0.973-Beta1-linux-x64/opt/firebird/lib/libib_util.so .cp ~/Firebird-5.0.0.973-Beta1-linux- x64/opt/firebird/plugins/libEngine13.so plugins # note: Still called 13scp rik@192.168.2.96:/home/rik/d/testfirebird .# install dependenciessudo apt-get install libncurses5sudo apt-get install libtommath1sudo apt-get install libtomcrypt1 # extra for Firebird 5.0sudo ln -s libtommath.so.1 /usr/lib/x86_64-linux- gnu/libtommath.so.0 # we need libtommath0# prepare and executeexport LD_LIBRARY_PATH=~/Desktop/fbtestexport FIREBIRD=~/Desktop/fbtest./testfirebird ---------------------------------------------------------------------- Handoko · 2023-05-01 15:47 Finally, it works! Sorry for the late reply. Thank you very much rvk for patiently guiding me providing detailed instructions. I learned a lot of thing, I feel like I've grown 1 inch taller And thank you everyone's suggestions. I'll try SQLite and Zeos when I'm not busy.