If you get something like:
Can't load D:\TEMP\par-76696b616d7768\cache-48ca417d0c47dd7f7245a1218d8d6614470afa93\7c34139c.xs.dll' for module XML::LibXML: load_file:The specified module could not be found at <embedded>/DynaLoader.pm line 193.
at <embedded>/PAR/Heavy.pm line 140.
BEGIN failed--compilation aborted at D:\TEMP\par-76696b616d7768\cache-48ca417d0c47dd7f7245a1218d8d6614470afa93\inc\lib/XML/LibXML.pm line 156.
Compilation failed in require at script/test.pl line 3.
BEGIN failed--compilation aborted at script/test.pl line 3.
then add the following test code
(check your path to Listdlls.exe and fix the below as needed)
#This is the code causing the issue
use XML::LibXML;
my $x = XML::LibXML->new();
ListPerlDLLs();
sub ListPerlDLLs
{
my @ret = `C:\\"Program Files"\\Sysinternals\\Listdlls.exe $$`; # $$ : current PID
foreach my $line (@ret)
{
$line =~ s/\s$//;
next if $line !~ /^0x\w+\s+\w+\s+(.+)/;
my $dll = $1;
next if $dll =~ /^c:\\windows\\/i;
print "$dll\n";
}
}
The Listdlls.exe is from Microsoft - see SysInternals \
First, double-click Listdlls.exe to accept the disclaimer
(will ask for approval on first launch).
When you run the Perl script, you will get something like this:
D:/strawberry-perl/perl/bin/perl.exe
D:/strawberry-perl/perl/bin/perl532.dll
D:/strawberry-perl/perl/bin/libgcc_s_seh-1.dll
D:/strawberry-perl/perl/bin/libwinpthread-1.dll
D:/strawberry-perl/perl/bin/libstdc++-6.dll
D:/strawberry-perl/perl/lib/auto/Encode/Encode.xs.dll
D:/strawberry-perl/perl/lib/auto/Fcntl/Fcntl.xs.dll
D:/strawberry-perl/perl/lib/auto/Storable/Storable.xs.dll
D:/strawberry-perl/perl/lib/auto/Data/Dumper/Dumper.xs.dll
D:/strawberry-perl/perl/lib/auto/IO/IO.xs.dll
D:/strawberry-perl/perl/vendor/lib/auto/XML/LibXML/LibXML.xs.dll
D:/strawberry-perl/c/bin/libxml2-2__.dll
D:/strawberry-perl/c/bin/libiconv-2__.dll
D:/strawberry-perl/c/bin/liblzma-5__.dll
D:/strawberry-perl/c/bin/zlib1__.dll
D:/strawberry-perl/perl/lib/auto/List/Util/Util.xs.dll
if you build your EXE and run it, you will get something like:
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/test.exe
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/perl532.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/libgcc_s_seh-1.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/libwinpthread-1.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/libstdc++-6.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/5461bd7b.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/1ed3ae5b.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/89b9c18b.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/18f23f26.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/0e796a00.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/5d0ea4ea.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/d3d27bc6.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/d8bcc032.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/64916f0f.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/76c6a0cc.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/6b1ff21f.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/4eceebd6.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/ebaed210.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/831f407e.xs.dll
D:/TEMP/par-76696b616d7768/cache-48ca417d0c47dd7f7245a1218d8d6614470afa93/7c34139c.xs.dll
D:/strawberry-perl/c/bin/libxml2-2__.dll
D:/strawberry-perl/c/bin/liblzma-5__.dll
D:/strawberry-perl/c/bin/zlib1__.dll
D:/strawberry-perl/c/bin/libiconv-2__.dll
The last four are the missing DLLs -
add them with --link
parameters:
call pp test.pl -o test.exe --link D:/strawberry-perl/c/bin/libxml2-2__.dll --link D:/strawberry-perl/c/bin/liblzma-5__.dll --link D:/strawberry-perl/c/bin/zlib1__.dll --link D:/strawberry-perl/c/bin/libiconv-2__.dll