distal-attribute
distal-attribute
distal-attribute
distal-attribute

[bug] Cannot find a usable libpg.dll ubuntu 16.04 i686 wine 1.6.2

goffyara posted 4 months ago in General

Cannot find a usable libpg.dll...

Not working in

HeidiSQL 9.4

HeidiSQL 9.4.0.5127 both 32+64bit installer and 32bit installer

But working in

HeidiSQL_9.3.0.5067-32_Setup.exe

ansgar posted 4 months ago

I updated numerous PostgreSQL libraries in r5068 (one after your working version), which probably causes your issue. Runs fine on any Windows version. Probably a privilege issue in your file system?

I also removed the file path string from the loaded libpq.dll in r5068, so that the code now looks like this:

LibPqHandle := LoadLibrary('libpq.dll');
if LibPqHandle = 0 then
  raise EDatabaseError.CreateFmt('Cannot find a usable ...');

... while in r5067 it looked like this:

LibWithPath := 'C:\Program files\HeidiSQL\libpq.dll';
if not FileExists(LibWithPath) then
  raise EDatabaseError.CreateFmt('Cannot find a usable ...');
LibPqHandle := LoadLibrary(LibWithPath);

I can probably make a check on the lib with path after the one without path failed.

goffyara posted 4 months ago

Ou, Sorry. My mistake. Text other:

"Невозможно найти пригодный для использования libpq.dll. Пожалуйста, запустите heidisql.exe из директории установки"

prnt.sc/czbwc7

ansgar posted 3 months ago

r5132 gives the library a second attempt to load, with the full path then. Please check if that solves your PostgreSQL issue on Wine.

Mairu posted 3 months ago

With r5132 and r5133 the error still occurs.

1 attachment(s):
  • heidisql_pgsql_wine_error
ansgar posted 3 months ago

Can you please turn on "Information messages" in HeidiSQL's preferences (tab "Logging"). Then, connect to some server which is working if you have one, then to the one which does not work. So the main window and the lower SQL log panel is visible at the time you are connecting to the pg server. That should give out some message in the log panel, saying

Trying to load library with full path: ...

That full path is of interest here. Perhaps it is wrongly concatenated.

Mairu posted 3 months ago

MySQL is working but no log message for loading of a dll is created. Also for Version 9.3 which is working no log entry is created.

For postgres the log entries are

/* 2016-11-25 09:00:30 [] */ /* Schreibe ab jetzt in Sitzungs Logdatei: Z:\data\programs\heidisql_9.4\logs\000002.log */
/* 2016-11-25 09:00:31 [local_pgsql] */ /* Trying to load library with full path: Z:\data\programs\heidisql_9.4\libpq.dll */

The path seems correct, perhaps the dll cannot be loaded with wine.

Mairu posted 3 months ago

I logged the wine output, and it looks like some more dlls are missing.

fixme:msg:ChangeWindowMessageFilter 400 00000001
fixme:wtsapi:WTSRegisterSessionNotification Stub 0x10094 0x00000000
fixme:win:LockWindowUpdate (0x20032), partial stub!
fixme:win:LockWindowUpdate ((nil)), partial stub!
fixme:win:LockWindowUpdate (0x20032), partial stub!
fixme:win:LockWindowUpdate ((nil)), partial stub!
fixme:ole:RemUnknown_QueryInterface No interface for iid {00000019-0000-0000-c000-000000000046}
err:module:import_dll Library MSVCR120.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\LIBEAY32.dll") not found
err:module:import_dll Library LIBEAY32.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\SSLEAY32.dll") not found
err:module:import_dll Library MSVCR120.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\SSLEAY32.dll") not found
err:module:import_dll Library SSLEAY32.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\libpq.dll") not found
err:module:import_dll Library MSVCR120.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\LIBEAY32.dll") not found
err:module:import_dll Library LIBEAY32.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\libpq.dll") not found
err:module:import_dll Library MSVCR120.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\libpq.dll") not found
err:module:import_dll Library MSVCR120.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\LIBEAY32.dll") not found
err:module:import_dll Library LIBEAY32.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\SSLEAY32.dll") not found
err:module:import_dll Library MSVCR120.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\SSLEAY32.dll") not found
err:module:import_dll Library SSLEAY32.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\libpq.dll") not found
err:module:import_dll Library MSVCR120.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\LIBEAY32.dll") not found
err:module:import_dll Library LIBEAY32.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\libpq.dll") not found
err:module:import_dll Library MSVCR120.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\libpq.dll") not found
fixme:win:WINNLSEnableIME hwnd 0x10144 enable -1: stub!
fixme:win:WINNLSEnableIME hwnd 0x10170 enable -1: stub!
fixme:win:WINNLSEnableIME hwnd 0x10144 enable -1: stub!
fixme:win:WINNLSEnableIME hwnd 0x10146 enable -1: stub!
fixme:wtsapi:WTSUnRegisterSessionNotification Stub 0x10094

I tried to download these files from www.dlldownloader.com without success.

err:module:import_dll Loading library LIBEAY32.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\SSLEAY32.dll") failed (error c000007b).
err:module:import_dll Loading library MSVCR120.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\SSLEAY32.dll") failed (error c000007b).
err:module:import_dll Library SSLEAY32.dll (which is needed by L"Z:\\data\\programs\\heidisql_9.4\\libpq.dll") not found
Mairu posted 3 months ago

Sorry for the double posts.

After updating to wine1.8 and installing vcrun2013 via winetricks - it is just the LIBEAY32.dll which is missing.

Then I downloaded an openssl package from [https]indy.fulgan[com]/SSL/ and extracted both ssleay32.dll and libeay32.dll into the heidisql folder.

Finally the error was gone.

ansgar posted 3 months ago

These both are also in the installer. Probably they also have path issues.

goffyara posted 3 months ago

Sorry for the double posts.

After updating to wine1.8 and installing vcrun2013 via winetricks - it is just the LIBEAY32.dll which is missing.

Then I downloaded an openssl package from [https]indy.fulgan[com]/SSL/ and extracted both ssleay32.dll and libeay32.dll into the heidisql folder.

Finally the error was gone.

thx. It helped

spanak posted 4 weeks ago

Hi, all. This is my first post in the forum!

I have tried running HeidiSQL under the same setup as goffyara, but with 64-bit Ubuntu instead. Initially, I got the same "cannot find a usable libpq.dll" error. Then I tried running Heidi from the terminal by issuing:

wine heidisql.exe

Then when I tried to connect to the database I actually got the real error message:

err:module:import_dll Library MSVCR120.dll (which is needed by L"C:\\Program Files\\HeidiSQL\\libpq.dll") not found

I found the .dll in question, put it next to the executable file and I was finally able to connect.

That being said, ansgar, is it possible to make the error message more informative? LIBPQ library could not be loaded indeed, but it was because another dependent library was missing. It should be very easy to reproduce the situation under Windows, too.

ansgar posted 4 weeks ago

So msvcr120.dll is used by libpq.dll? Didn't know that, but well, there are many dependencies from some Windows DLL.

r5146 tries to add the error message which Windows provides after failing to load libpq.dll (and/or libmysql.dll). Probably there is some useful information inside that message. I could however not reproduce the same here.

spanak posted 4 weeks ago

It's not only libpq.dll, libeay32.dll and ssleay32.dll also need it. I just didn't copy all the error messages, but I you can see them in Mairu's post above.

Actually, the error I am seeing is actually specific to wine and it is just printing it in the terminal, it is not throwing an exception or something like that.

I have tried r5146, but I still get the generic "missing libpq.dll" message. Bad luck, I guess there would be no way to figure out the real error unless you actually check if msvcr120.dll is missing before loading the rest of the libraries.

Anyway, hopefully all this can be of help to someone else.

Please login to leave a reply, or register at first.