Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: pp missing module error

by haj (Vicar)
on May 27, 2020 at 16:19 UTC ( [id://11117347]=note: print w/replies, xml ) Need Help??


in reply to pp missing module error

I guess that the problem is caused by GD.pm's nature as "just" an interface to the GD library. This library comes with Strawberry Perl. I don't have a Windows system available right now, but by looking at sources from an old project I guess that you need to add the library explicitly:

pp ... --link=libgd-3__.dll

Verify the name of the DLL, it should be located in Strawberry's c/bin directory.

Edited: it's --link, not --lib. And yes, that's two underscores.

Replies are listed 'Best First'.
Re^2: pp missing module error
by nzsvz9 (Sexton) on May 27, 2020 at 18:44 UTC
    I've altered the pp command as follows:
    pp -v --output myprogram.exe --link=C:\Strawberry\c\bin\libgd-3__.dll +--link=C:\Strawberry\perl\vendor\lib\auto\Class\Load\XS\XS.xs.dll myp +rogram.pl
    Still getting the same error.

    I REALLY don't want to have to install perl and libraries on a target computer to run this - people just want an exe to run ...

      Ok, I got hold of two Windows systems... one to build the executable, the other with no Strawberry (such things exist!) to run it. Here's the pp invocation in my .bat file:
      pp --verbose ^ --link=libgd-3__.dll ^ --link=libbz2-1__.dll ^ --link=libgraphite2__.dll ^ --link=libharfbuzz-0__.dll ^ --link=libfreetype-6__.dll ^ --link=libiconv-2__.dll ^ --link=libjpeg-9__.dll ^ --link=liblzma-5__.dll ^ --link=libpng16-16__.dll ^ --link=libtiff-5__.dll ^ --link=libXpm__.dll ^ --link=zlib1__.dll ^ --module=GD ^ --output=gdpacked.exe ^ pack_gd.pl

      The program pack_gd.pl is just the synopsis from GD on metacpan. Running pp produces no error, and running the executable prints a PNG image. So when you run it, remember to redirect the output to a .png file.

      In my first reply, I mixed up some dashes with underscores and missed a few dependencies. Sorry.

        Thanks very much - this worked - explicitly linking in the list of libraries.

        I did also try ppsimple - however the install of Proc::Background failed test 47 and did not install - after installing SomeUtils and AllUtils. But, I digress.

        My sincere thanks to everyone who chimed in to help - and get this off zero for me - you are appreciated :)

      Oh well... The GD library has a few dependencies by itself. Here's a list of suspects:
      • libfreetype_6__.dll
      • libiconv_2__.dll
      • libjpeg_9__.dll
      • libpng16_16__.dll
      • libtiff_5__.dll
      • libXpm__.dll
      • zlib1__.dll

      That's just from the strings in libgd-3__.dll, I can't say whether the list is comprehensive. I'll probably get some time to experiment on my Windows box in a few days.

      As an aside: As far as I can say, You don't need to provide the absolute path to the libraries. pp should find them as they're on pp's path.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11117347]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-23 17:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found