[solved] ZConnection.libraryLocation
Moderators: gto, EgonHugeist, olehs
[solved] ZConnection.libraryLocation
Hello
I'm compiling my executable application developed with Zeos 7 and Lazarus 09.30.4 and Postgresql 9.1 and Windows7 32.
And the same libpq81.dll not find the dll, the dll is already in the same directory as the executable and yet the message remains.
The message:
None of the dynamic libraries Can Be found or is not loadable: libpq81.dll libpq.dll!
Use TZConnection.libraryLocation if the location is invalid.
What can be?
Edson
I'm compiling my executable application developed with Zeos 7 and Lazarus 09.30.4 and Postgresql 9.1 and Windows7 32.
And the same libpq81.dll not find the dll, the dll is already in the same directory as the executable and yet the message remains.
The message:
None of the dynamic libraries Can Be found or is not loadable: libpq81.dll libpq.dll!
Use TZConnection.libraryLocation if the location is invalid.
What can be?
Edson
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Edson,
this may be a stupid question: Different compilete versions in 32/64Bit? And one of the unsupported dll's was found in the Path environment? A 64Bit exe can not load a 32Bit dll header or reverted as far as i know...
I do not see another possibility to get this exception if the files do exist.
Michael
this may be a stupid question: Different compilete versions in 32/64Bit? And one of the unsupported dll's was found in the Path environment? A 64Bit exe can not load a 32Bit dll header or reverted as far as i know...
I do not see another possibility to get this exception if the files do exist.
Michael
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Ok Edson. We start from the premise that you've a 32Bit Application and 32Bit dll.
Are all dll's of PostgreSQL avaiable in that directory? Not only the libpg.dll?
Michael
Are all dll's of PostgreSQL avaiable in that directory? Not only the libpg.dll?
Michael
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
elidorio2,
my first advice clean up that folder. Keep only the librarys you need (copy them from the PostgreSQL\Bin folder). And i join with ism here. In your case use TZLibraryLocation = ''; because the system finds th dll's in your application folder. Also be sure you do not have another version in the Windows\system directory.
That exception will only be raised if the function LoadLibrary does not return a valid handle or the dll is realy not found. These are the two possibilities and nothing else is possible.
Michael
my first advice clean up that folder. Keep only the librarys you need (copy them from the PostgreSQL\Bin folder). And i join with ism here. In your case use TZLibraryLocation = ''; because the system finds th dll's in your application folder. Also be sure you do not have another version in the Windows\system directory.
That exception will only be raised if the function LoadLibrary does not return a valid handle or the dll is realy not found. These are the two possibilities and nothing else is possible.
Michael
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
elidorio2,
Ok step by step, Edson. Tell me do you use the TZConnection.LibraryLocation ? Is that property empty?
Michael
Ok step by step, Edson. Tell me do you use the TZConnection.LibraryLocation ? Is that property empty?
Michael
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
Hello Michael,
The dll files are todoas in the current directory. Strange all the dll are in the directory and it is asking for libpq and libpq81.
I moved all the dll to the system32 and even then, and still the problem pesiste. I've been searching on google and found several people with the same problem, the solution is not encotrei yet!
Note, I'm using postgresql 9.1.
Please if possible do a test there, create an exe and try to run it on another machine.
Edson
The dll files are todoas in the current directory. Strange all the dll are in the directory and it is asking for libpq and libpq81.
I moved all the dll to the system32 and even then, and still the problem pesiste. I've been searching on google and found several people with the same problem, the solution is not encotrei yet!
Note, I'm using postgresql 9.1.
Please if possible do a test there, create an exe and try to run it on another machine.
Edson
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
elidorio2,
Hmm curious. Edson you bo not need the libpq81.dll the libpq.dll from the PostgreSQL\Bin folder should be enough.
Edson please scan that Harddisk for additional available libpg*.dll. I've tested this (not with XP) and it works. Check the path= environment variable (Start\control-panel\...).
I'm still thinking that your app and that dll is incompatible. Test it by your self:
Open ZPlainLoader.pas
Add there a line for fileexist(Location) or an errormessage which will be raised if the Handle is invalid..
Michael
Hmm curious. Edson you bo not need the libpq81.dll the libpq.dll from the PostgreSQL\Bin folder should be enough.
Edson please scan that Harddisk for additional available libpg*.dll. I've tested this (not with XP) and it works. Check the path= environment variable (Start\control-panel\...).
I'm still thinking that your app and that dll is incompatible. Test it by your self:
Open ZPlainLoader.pas
Code: Select all
function TZNativeLibraryLoader.ZLoadLibrary(Location: String): Boolean;
begin
if FLoaded then
Self.FreeNativeLibrary;
FLoaded := False;
Result := False;
{$IFDEF UNIX}
{$IFDEF FPC}
FHandle := LoadLibrary(PAnsiChar(Location));
{$ELSE}
FHandle := HMODULE(dlopen(PAnsiChar(Location), RTLD_GLOBAL));
{$ENDIF}
{$ELSE}
FHandle := LoadLibrary(PChar(Location));
{$ENDIF}
if (FHandle <> INVALID_HANDLE_VALUE) and (FHandle <> 0) then
begin
FLoaded := True;
FCurrentLocation := Location;
Result := True;
end;
end;
Michael
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
Hello Michael,
What's to understand is that Zeos does not read the other directory unless the C: \ Program Files \ PostgreSQL \ 9.1 \ bin.
In my opinion he is trying to get the dll in the directory above.
On my development computer it finds the dll normal, because they are in the directory above, now when I change the exe to another computer he can not find something that dll.
What's to understand is that Zeos does not read the other directory unless the C: \ Program Files \ PostgreSQL \ 9.1 \ bin.
In my opinion he is trying to get the dll in the directory above.
On my development computer it finds the dll normal, because they are in the directory above, now when I change the exe to another computer he can not find something that dll.
You do not have the required permissions to view the files attached to this post.
Today I installed PostgreSQL 9.1.4-64 bits.
Everything works fine on D2006, DXE232/64, and Lazarus Win 32/64.
On the server and three computers Win7 32/64, Win 7 32 and Vista 32 after installing the appropriate client libraries to the appropriate system directories or in the application directory.
Zeos 7 testing-egonhugeist rev.1389
Michal Abramczyk
Everything works fine on D2006, DXE232/64, and Lazarus Win 32/64.
On the server and three computers Win7 32/64, Win 7 32 and Vista 32 after installing the appropriate client libraries to the appropriate system directories or in the application directory.
Zeos 7 testing-egonhugeist rev.1389
Michal Abramczyk