Bogdan Grabinski 1 Posted January 23, 2022 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. Yes I attempted to access Postgresql 14.1 as well, same issue. 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
Mohammed Nasman 11 Posted January 23, 2022 It seems you are building win32 application but trying to use 64 bit version of the "libpq.dll" library. Share this post Link to post
Serge_G 87 Posted January 23, 2022 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 ) 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 1 Share this post Link to post
miab 25 Posted January 23, 2022 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 Posted January 23, 2022 (edited) 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 January 23, 2022 by Guest Share this post Link to post
Guest Posted January 23, 2022 (edited) 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 January 23, 2022 by Guest bitly Share this post Link to post
Pat Heuvel 1 Posted January 24, 2022 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
Bogdan Grabinski 1 Posted January 29, 2022 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. 1 Share this post Link to post