Can not load PostgreSQL library "libpql.dll" [SOLVED] lazarus / 16-Databases ---------------------------------------------------------------------- stoffman · 2020-11-20 12:20 Hi, I build the simplest application that tries to connect to Postgres. And it cannot load the libql.dll I placed the dll file in the same directory of the exe file, I made sure it is of the same version (win64) I set the path correctly. Is is some sort of bug? It driving me nuts. Ideas? (Lazarus 2.0.10 Windows 64bit) Thanks, ---------------------------------------------------------------------- Zvoni · 2020-11-20 12:54 IIRC, if running in IDE the dll has to be beside the Lazarus-exe...... at least it was that way with sqlite.... ---------------------------------------------------------------------- stoffman · 2020-11-20 13:50 Sadly that is not the case. It also happens when I'm running the exe file itself (and the dll is placed in the directory of the exe) ---------------------------------------------------------------------- eny · 2020-11-20 14:53 Is that the right dll name? When I look in one of the PQ sources I see 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 {$IFDEF Windows}  const    pqlib = 'libpq.dll'; // Not sure if it has a version number ?{$ENDIF} ---------------------------------------------------------------------- stoffman · 2020-11-20 15:08 Yes this is the correct name. See the attached file. ---------------------------------------------------------------------- Mimmo · 2020-11-20 16:13 Please check to have ssleay32.dll, libeay32.dll and libintl-9.dll in the same folder of lipq.dll. You can also try to run a dependencies inspector like DepencyWalker against libpql.dll to check if all the necessary dll files are installed in your system. ---------------------------------------------------------------------- stoffman · 2020-11-21 05:57 So many of the dependencies are missing. Is there a utility that auto download  all the missing dll files? (The rabbit hole is deep on this one. I'm also missing some VC related DLL and what not) ---------------------------------------------------------------------- stoffman · 2020-11-21 14:01 For future generations: I copied "libpq.dll" from postgres bin directory: https://get.enterprisedb.com/postgresql/postgresql-13.1-1-windows-x64- binaries.zip I also add to copy from this repository both "libiconv-2.dll" and "libintl-8.dll" (you can find it pgAdmin4 directory) Finally I had to install openssl for windows: http://slproweb.com/download/Win64OpenSSL_Light-1_1_1h.exe Thanks everyone for the help!