Jump to content

Recommended Posts

I am back from Borland C++ Builder 5, skipped 10 years, and now on Embarcadero C++ Builder 11 PRO.

I my have annoying questions with all good intentions of better tools.

To the point.

Attempting to access PostgreSQL 13 installed on local Windows 10 development box, using FireDAC components with 64 bit VCL Windows desktop project.

I am getting error message stating the I need 32 bit version of libpq.dll.

I got semi smart and supplied path to 32 bit libpq.dll from older postgres version 10, and all started to work at design time.

Unfortunately compiled version trow error that it need 64 bit version of libpq.dll.

Is there smart workaround this circle of errors embarcadero put mi in?

 

Hope it is just my 10 years of not using excellent productivity tool.

 

image.thumb.png.1e88eafe842b859d3e52721a566af15d.png Yes I attempted to access Postgresql 14.1 as well, same issue.

 

image.thumb.png.eb2e9d2dd93631d40fc97942a7e85c44.png That I got running 64 bit application.

 

Is there separate path option for libpq.dll 32bit for design time, and 64 bit for rune time?

 

 

 

Share this post


Link to post

Hi, first you have to install the two versions of PostgreSQL (32 and 64) the first for the IDE the second when running/debugging 64 apps

On the other hand, at runtime you can change library path (before connecting :classic_wink:) for this you need to put a FDPhysPgDriverLink (give it a DriverID, id to be used by FDConnection)

and then you will be able to change Vendorlib 

  • Like 1

Share this post


Link to post

You should install 32 and 64 bit PostgreSQL clients and ensure their exclusive visibility in both modes or explicitly point to the client libraries entry before the connection.

Share this post


Link to post
Guest

Some RDBMS can be installed 32 bit or 64 bit, but that is server-side.

The IDE is 32 bit. The IDE needs to be able to access the 32 bit client lib.

If you compile to Win64 target, that exe needs the 64 bit lib (runtime).

If you compile to Win32 target, that exe needs the 32 bit lib (runtime).

Edited by Guest

Share this post


Link to post
Guest
7 hours ago, Serge_G said:

Hi, first you have to install the two versions of PostgreSQL (32 and 64) the first for the IDE the second when running/debugging 64 apps

That sound odd to me. Do you actually need a 64 bit server installation to debug a 64 bit application?

Edited by Guest
bitly

Share this post


Link to post

You should only need the bitness that relates to your binary. But you will also get the same message if the libraries that libpq needs aren't there, so make sure you also have:

libeay32.dll

libintl-8.dll

ssleay32.dll

in the same directory.

 

If you still need the 32-bit libpq, you can get it by downloading an old pgadmin.

Share this post


Link to post

Thank you fellow programmers for the help.

I managed do have path to 32 bit libpq.dll using

FDPhysPgDriverLink->VendorLib

This way I have active VCL components with connection to Postgresql server that is 64 bit ( version 14.1 on windows 10).

Basic functionality works, as to more adventured as Json data type, I have not tested.

Before I compile I have to change the property of

FDPhysPgDriverLink->VendorLib

to have path to 64 bit version of libpq.dll

 

The Embarcadero manual for how to connect to postgresql is not very helpful (old,not tested with new database).

The list if dll's I used is larger then in manual as well.

 

I will describe all details after more testing.

As of now I have not found where in code to change the property of

FDPhysPgDriverLink->VendorLib

so it will work for runtime.

 

PS. I installed Lazarus 2.2.0 and connected postgresql as well.

  • Thanks 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×