Closed hoppfrosch closed 1 year ago
Can't load 'C:\Users\XXX\AppData\Local\Temp\par-6a6f6b\cache-796f45c9f359ff639862f1260cfe0060cbe429a0\1dfc9682.xs.dll' for module XML::Parser::Expat: load_file:The specified module could not be found at
/DynaLoader.pm line 193. at /PAR/Heavy.pm line 140.
The problem is most likely that module XML::Parser::Expat
has an XS part (i.e. .../XML/Parser/Expat/Expat.xs.dll) that is linked against the "real" expat DLL, e.g. libexpat.dll. To confirm, run objdump -ax
on the dll from the "Can't load" error message and look for "DLL Name: ...." lines in the output.
libexpat.dll comes with Strawberry, but PAR::Packer
does not pack it automagically (see https://github.com/rschupp/PAR-Packer/issues/67#issuecomment-1249196382 for a more elaborate explanation), hence the packed executable will work on machines that have Strawberry installed (or have libexpat.dll in their PATH
from some other distribution) and fail on others.
To fix, either add libexpat.dll manually (with pp --link ...
) or use Shawn Laffan's APP::PP::Autolink.
Following your recommendation, I used Shawn Laffan's APP::PP::Autolink to compile/pack my PerlScript. The newly compiled exe significantly grows in size in comparison to the erroneous one. Looking inside the exe, libexpat.dll is available - as you predicted correctly (libexpat.dll was not available in the erroneous version).
Running the new exe on different machines works as predicted without any flaws ....
Thanky you so much for your fast and helpful answer! You are my hero of the day ;-)
Hi there,
I compiled a quite complex Perl Script via pp.bat on a reference machine. Running the produced exe on a few different computers was successfull - whilst on most other computers execution of compiled exe failed due to an error
The error message during execution is as follows:
The reference machine - where compilation took place - has following parameters:
I used the following command line to compile:
pp.bat --execute --lib=..\lib --output=ABC.exe --xargs="-c TmpConfig.xml" ABC.pl
The resulting ABC.exe has a size of approx 15MB.
Running ABC.exe on several windows machines (different OS Versions, some with local Perl installed, some not ...) leads to different results. Whilst execution on a few machines succeeds, exection failed on an most machines due to error above.
What I analyzed/tried yet:
I found no sytematics to distinguish the erroneous machines from succcessful machines.