Recent

Author Topic: libpq does not load, please help  (Read 2055 times)

unittsistems

  • New member
  • *
  • Posts: 9
libpq does not load, please help
« on: August 06, 2025, 02:41:25 pm »
Please help me, I'm trying to compile an .exe in Delphi but there's a problem with the Postgres database, saying that Libpq was found but it couldn't be loaded, my Delphi is in 32 bits, the exe too, and the dlls are also in 32 bits.
I use Windows 10, Postgres 15 64 bits, and I've already tried putting libpq and its dependencies in the .exe folders, and in the Postgres Lib and Bin folders

 
« Last Edit: August 06, 2025, 03:26:52 pm by unittsistems »

gues1

  • Guest
Re: libpq does not load, please help
« Reply #1 on: August 06, 2025, 04:00:29 pm »
Please help me, I'm trying to compile an .exe in Delphi ....
LOL, why you write here ? This is Lazarus / FPC forum ... but may be someone can help you.

Anymore, are you sure about 32 bit libs of Postgress ? Are you using a FDPhysPgDriverLink with VENDORLIB property set to that lib (libpq.dll)?

EDIT: take care that there should be a lot of other 32 bit DLL in the same place where libpq.dll is. I have 11 dll.....
« Last Edit: August 06, 2025, 04:06:08 pm by gues1 »

unittsistems

  • New member
  • *
  • Posts: 9
Re: libpq does not load, please help
« Reply #2 on: August 06, 2025, 04:08:10 pm »
Sorry, I couldn't find anywhere else to solve this problem. I saw there were related things, so I decided to register. The libpq.dll in Postgres is supposed to be 64-bit, but the .exe is 32-bit.

And about your second question, I haven't used any of that, and I don't even know how to set it. I'm just an intern trying to solve a problem that even developers here can't solve.

and there are several other DLLs in the executable, along with libpq and its dependencies
« Last Edit: August 06, 2025, 04:10:22 pm by unittsistems »

gues1

  • Guest
Re: libpq does not load, please help
« Reply #3 on: August 06, 2025, 04:16:54 pm »
You cannot use 64 bit dll with an 32 bit application. You must find the 32 bit DLL of Postgres.

The worse thing is that Postgres 15 dll packages are not anymore available ... there are for 16 and 17 Postgres release, but not for 15 (may be they are somewhere but I'm not able to find them).

If in this forum no one can help you, you can go in this other forum that is specif for Delphi: https://en.delphipraxis.net/

What version of Delphi are you using ?

unittsistems

  • New member
  • *
  • Posts: 9
Re: libpq does not load, please help
« Reply #4 on: August 06, 2025, 04:24:28 pm »
what if I take libpq and its dependencies from the executable, and replace the 64-bit ones in the Postgres bin and lib folders with them? would it work?

and I'm using Delphi 10.2, I'll see if I can get help on this Delphi forum, I really appreciate your help 😁

EDIT: I realized that it is not possible to create an account in this forum now, would there be another forum that you know of?
« Last Edit: August 06, 2025, 04:28:49 pm by unittsistems »

gues1

  • Guest
Re: libpq does not load, please help
« Reply #5 on: August 06, 2025, 04:42:17 pm »
I can ask if I can invite you. I write here when I know something.

what if I take libpq and its dependencies from the executable, and replace the 64-bit ones in the Postgres bin and lib folders with them? would it work?

If the Postgres is installed in the "Program Files (x86)" ... yes it can works.

unittsistems

  • New member
  • *
  • Posts: 9
Re: libpq does not load, please help
« Reply #6 on: August 06, 2025, 04:45:53 pm »
It is installed only in Program Files, not in x86, would there be any problem?

and if you can invite me to the Delphi forum, I need to resolve this error as soon as possible, if possible, I would be very grateful

gues1

  • Guest
Re: libpq does not load, please help
« Reply #7 on: August 06, 2025, 05:07:16 pm »
It is installed only in Program Files, not in x86, would there be any problem?

You cannot use those.

You must have 32 bit dll.

NEWS: this is a link for 32 bit dll https://ftp.postgresql.org/pub/odbc/versions.old/dll/psqlodbc_15_00_0000.zip

unittsistems

  • New member
  • *
  • Posts: 9
Re: libpq does not load, please help
« Reply #8 on: August 06, 2025, 05:18:30 pm »
I downloaded your file, put it in the postgres folder and in the exe folder and extracted it, but the error persists, did I do it right?

gues1

  • Guest
Re: libpq does not load, please help
« Reply #9 on: August 06, 2025, 05:24:40 pm »
You have done bad ... You have to put those dll only in the exe folder (I mean, where your application is) ....

But I don't know Postgres so you can download the 64 bit dll and overwrite them in the original Prostgres folder.

This is the link: https://ftp.postgresql.org/pub/odbc/versions.old/dll/psqlodbc_15_00_0000-x64.zip

unittsistems

  • New member
  • *
  • Posts: 9
Re: libpq does not load, please help
« Reply #10 on: August 06, 2025, 05:33:24 pm »
Okay, I've already redone everything the way it was, now it's only in the executable folder, but the error continued, so I put the files that were in the folders you sent me, and put them in the same folder as the executable and the error continued

gues1

  • Guest
Re: libpq does not load, please help
« Reply #11 on: August 06, 2025, 05:48:24 pm »
And I cannot help you more that this. May be someone that know very well Postgres and Delphi can help you better.

It's strange, 'cause seems that Delphi (your application) is searching the lib somewhere, may be not in the exe directory.

I still wait for DelphiPraxis answer.

unittsistems

  • New member
  • *
  • Posts: 9
Re: libpq does not load, please help
« Reply #12 on: August 06, 2025, 05:52:25 pm »
exactly, the problem is that it says it found libpq.dll in the .exe folder, and still can't load it, even though the DLLs are 32-bit

but thank you so much for your help so far

gues1

  • Guest
Re: libpq does not load, please help
« Reply #13 on: August 06, 2025, 07:07:21 pm »
@unittsistems
Send me a PM (message) with your nickname and your e-mail, I must do the same for you to admin of DelphiPraxis.

You'll receive an e-mail  and you will able to activate new account.

unittsistems

  • New member
  • *
  • Posts: 9
Re: libpq does not load, please help
« Reply #14 on: August 06, 2025, 08:37:16 pm »
Did my PM reach you?

 

TinyPortal © 2005-2018