Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

XML::LibXML with pp on windows

by sectokia (Scribe)
on Dec 16, 2021 at 01:01 UTC ( #11139655=perlquestion: print w/replies, xml ) Need Help??

sectokia has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks. I cannot figure out how to package a program that uses XML::LibXML. I am using strawberry perl on windows. I convert the perl program to exe:

Make exe like this:

pp -I lib -l c:\strawberry\c\bin\zlib1__.dll -l c:\strawberry\c\bin\li +bxml2-2__.dll -l c:\strawberry\c\bin\libiconv-2__.dll -x --xargs=pp - +I ..\source ..\source\testxx.pl -o ..\bin\testxx.exe

When I run on the system that generated the exe (with strawberry perl installed) it runs OK.

Running on another system (that doesn't have perl installed) produces this error:

Can't load 'C:\Users\USER~1\AppData\Local\Temp\par-5741444d436f7474657 +244616e\cache-f5208665237b7d0dd36c5b6942120a85a57da865\7c34139c.xs.dl +l' for module XML::LibXML: load_file:The specified module could not b +e found at <embedded>/DynaLoader.pm line 193. at <embedded>/PAR/Heavy.pm line 140. BEGIN failed--compilation aborted at C:\Users\USER~1\AppData\Local\Tem +p\par-5741444d436f7474657244616e\cache-f5208665237b7d0dd36c5b6942120a +85a57da865\inc\lib/XML/LibXML.pm line 156. Compilation failed in require at C:\Users\USER~1\AppData\Local\Temp\pa +r-5741444d436f7474657244616e\cache-f5208665237b7d0dd36c5b6942120a85a5 +7da865\inc\lib/testx.pm line 14. BEGIN failed--compilation aborted at C:\Users\USER~1\AppData\Local\Tem +p\par-5741444d436f7474657244616e\cache-f5208665237b7d0dd36c5b6942120a +85a57da865\inc\lib/testx.pm line 14. Compilation failed in require at script/testxx.pl line 10. BEGIN failed--compilation aborted at script/testxx.pl line 10.

My guess is I need to include something...xs.dll. I notice by searching there are a lot of *.xs.dll files in strawberry perl sub folders. How do I know what I need to include? Is there any way to list all the DLL's that get loaded when I run the script normally, so I can have them linked to pp?

Thanks for any help! Have been stuck on this for a quite a while!

Replies are listed 'Best First'.
Re: XML::LibXML with pp on windows
by swl (Vicar) on Dec 16, 2021 at 03:51 UTC

    You are probably missing a second level dependency (i.e. one or more of the DLLs you are packing depends on another DLL you are not listing).

    Give pp_autolink from App::PP::Autolink a go. I just tested with the script below. It fails using a plain pp call (in the same way that your call does), but passes with pp_autolink.

    use strict; use warnings; use XML::LibXML; print 'done';

      Thank you!

      pp_autolink built exe works, and pp_autolink shows the missing DLL was:

      c:\strawberry\c\bin\liblzma-5__.dll

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11139655]
Approved by kcott
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2022-05-24 22:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (84 votes). Check out past polls.

    Notices?