Recent

Author Topic: Can not load PostgreSQL library "libpql.dll" [SOLVED]  (Read 523 times)

stoffman

  • New Member
  • *
  • Posts: 31
Can not load PostgreSQL library "libpql.dll" [SOLVED]
« on: November 20, 2020, 01:20:07 pm »
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,
« Last Edit: November 21, 2020, 03:02:00 pm by stoffman »

Zvoni

  • Sr. Member
  • ****
  • Posts: 429
Re: Can not load PostgreSQL library "libpql.dll"
« Reply #1 on: November 20, 2020, 01:54:37 pm »
IIRC, if running in IDE the dll has to be beside the Lazarus-exe......
at least it was that way with sqlite....
One System to rule them all, One IDE to find them,
One Code to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
People call me crazy, because i'm jumping out of perfectly fine aircraft

stoffman

  • New Member
  • *
  • Posts: 31
Re: Can not load PostgreSQL library "libpql.dll"
« Reply #2 on: November 20, 2020, 02:50:46 pm »
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)
« Last Edit: November 20, 2020, 03:01:17 pm by stoffman »

eny

  • Hero Member
  • *****
  • Posts: 1617
Re: Can not load PostgreSQL library "libpql.dll"
« Reply #3 on: November 20, 2020, 03:53:39 pm »
Is that the right dll name?
When I look in one of the PQ sources I see

Code: Pascal  [Select][+][-]
  1. {$IFDEF Windows}
  2.   const
  3.     pqlib = 'libpq.dll'; // Not sure if it has a version number ?
  4. {$ENDIF}
  5.  
 
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

stoffman

  • New Member
  • *
  • Posts: 31
Re: Can not load PostgreSQL library "libpql.dll"
« Reply #4 on: November 20, 2020, 04:08:41 pm »
Yes this is the correct name.

See the attached file.


Mimmo

  • New member
  • *
  • Posts: 7
Re: Can not load PostgreSQL library "libpql.dll"
« Reply #5 on: November 20, 2020, 05:13:52 pm »
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

  • New Member
  • *
  • Posts: 31
Re: Can not load PostgreSQL library "libpql.dll"
« Reply #6 on: November 21, 2020, 06:57:31 am »
 %) 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

  • New Member
  • *
  • Posts: 31
Re: Can not load PostgreSQL library "libpql.dll"
« Reply #7 on: November 21, 2020, 03:01:29 pm »
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!





 

TinyPortal © 2005-2018