Recent

Author Topic: [SOLVED] Problem in Components/paradox/demo/testparadox.exe  (Read 4193 times)

Hopestation

  • Full Member
  • ***
  • Posts: 164
[SOLVED] Problem in Components/paradox/demo/testparadox.exe
« on: January 03, 2016, 01:55:40 pm »
Hi.
I am using Lazarus 1.4.4, fpc 2.6.4 in Windows10.

I tried running this executable. There is no Paradox file provided so I chose Biblio.db from pdx/demos/fishfact.

I got the message "Could not load the library libpx.so.0".

I searched the Lazarus folder and couldn't find it so I looked on line and found references to the RPM version for Linux but nothing for Windows.

I thought that maybe the exe file was compiled for Linux, so I copied the demo folder to my local Lazarus folder and compiled it in Lazarus. It compiled without a problem but when it ran it gave a similar message.

Checking the components I found in the Tparadox component PXlibrary was set to
libpx.so.0.

What should this be set to for Windows?

Thanks.
« Last Edit: January 03, 2016, 10:15:17 pm by Hopestation »

GetMem

  • Hero Member
  • *****
  • Posts: 3506
Re: Problem in Components/paradox/demo/testparadox.exe
« Reply #1 on: January 03, 2016, 02:12:15 pm »
Click to PDX component(TParadox) then change PXLibrary property from libpx.so.0 to whatever dll is the equivalent under windows.

Hopestation

  • Full Member
  • ***
  • Posts: 164
Re: Problem in Components/paradox/demo/testparadox.exe
« Reply #2 on: January 03, 2016, 02:30:31 pm »
I've looked for Paradox dll online and found an answer from 2014 on this forum. It included an attached pxlib.dll, which I have downloaded and copied into the components\paradox\Lib\i386-win32\win32 and added this path to Project Options/ Lib. I have also copied into Windows\SYSWOW.

I have set the PXLibrary to pxlib.dll.

When I try to activate the table I get the message "Could not load library : pxlib.dll.

What should I do next?

GetMem

  • Hero Member
  • *****
  • Posts: 3506
Re: Problem in Components/paradox/demo/testparadox.exe
« Reply #3 on: January 03, 2016, 02:59:55 pm »
The library is loaded internally by pxlib.pp which is a FPC unit. Anyway open a new project then try the following(make sure pxlib.dll is in the project or system folder:

Code: Pascal  [Select]
  1. uses dynlibs;
  2.  
  3. procedure TForm1.Button1Click(Sender: TObject);
  4. var
  5.   DllHandle: TLibHandle;
  6. begin
  7.   DllHandle := LoadLibrary('pxlib.dll');
  8.   if DllHandle = 0 then
  9.     ShowMessage(SysErrorMessage(GetLastOSError))
  10.   else
  11.     ShowMessage('Successfully loaded');
  12. end;      
 

What is the error message?

Hopestation

  • Full Member
  • ***
  • Posts: 164
Re: Problem in Components/paradox/demo/testparadox.exe
« Reply #4 on: January 03, 2016, 04:09:48 pm »
I get the message:

  "The specified module could not be found"

I found pxlib.pp in

    C:\lazarus\fpc\2.6.4\source\packages\pxlib\src.

Does this tell you anything?

GetMem

  • Hero Member
  • *****
  • Posts: 3506
Re: Problem in Components/paradox/demo/testparadox.exe
« Reply #5 on: January 03, 2016, 04:51:18 pm »
Quote
"The specified module could not be found"
It means:
 1. the dll is not present
 2. it's corrupted
 3. it's the wrong architecture(32/64)

Quote
I found pxlib.pp in
    C:\lazarus\fpc\2.6.4\source\packages\pxlib\src.
Does this tell you anything?
I know is there. pxlib will try to load the dll in the same way as we did(see procedure Loadpxlib). 

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 753
Re: Problem in Components/paradox/demo/testparadox.exe
« Reply #6 on: January 03, 2016, 04:52:27 pm »
hello,
it seems there is a problem with the library pxlib.dll.

when i open this dll with the program dependancy walker ( to see dlls dependancies) i have this error :

Quote
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.

and the line in error  is on iconv.dll 64 bits .  Why a dependancy on a 64 bits dll for a 32 bits dll ?
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 753
Re: Problem in Components/paradox/demo/testparadox.exe
« Reply #7 on: January 03, 2016, 05:05:44 pm »
found a solution :   :)

try to find the file iconv.dll (32 bits) in your system and put this dll in the same directory that your pxlib.dll

If you can't find the iconv.dll in your system , you can find it in this zip file : ftp://ftp.gnupg.org/gcrypt/binary/libiconv-1.9.1.dll.zip
« Last Edit: January 03, 2016, 05:30:18 pm by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

Hopestation

  • Full Member
  • ***
  • Posts: 164
Re: Problem in Components/paradox/demo/testparadox.exe
« Reply #8 on: January 03, 2016, 10:14:48 pm »
Thanks for that.

I found iconv.dll in xampp\Mercurymail and it solves the problem.