Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

PAR packer error

by reaper9187 (Scribe)
on Dec 31, 2012 at 04:35 UTC ( #1010988=perlquestion: print w/replies, xml ) Need Help??
reaper9187 has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks .. I seek your wisdom on an issue ...

i have been trying to create a binary executable file from my script ... i have installed PAR packer using PPM ... When i try to compile the script .. it throws the following error ..
Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\abhinav\Desktop\Demo _19_12>pp -o myscript.exe Set up gcc environment - 4.4.7 20111023 (prerelease) [svn/rev.180339 - + mingw-w64 /oz] Perl lib version (5.16.1) doesn't match executable 'C:\Users\abhinav\A +ppData\Loc al\Temp\parlbbnG.exe' version (v5.16.0) at C:/Perl64/lib/ lin +e 60. Compilation failed in require at C:/Perl64/lib/ line 8. BEGIN failed--compilation aborted at C:/Perl64/lib/ line 8. Compilation failed in require at C:/Perl64/lib/File/ line 148. BEGIN failed--compilation aborted at C:/Perl64/lib/File/ line 1 +48. Compilation failed in require at C:/Perl64/lib/Archive/ line 14. BEGIN failed--compilation aborted at C:/Perl64/lib/Archive/ line + 14. Compilation failed in require at -e line 459. C:\Perl64\site\bin/pp: Failed to extract a parl from 'PAR::StrippedPAR +L::Static' to file 'C:\Users\abhinav\AppData\Local\Temp\parl6JbDHoF.exe' at C:/P +erl64/site /lib/PAR/ line 1169, <DATA> line 1. C:\Users\abhinav\Desktop\Demo _19_12>

I can see the issue is related to incompatibility of the Packer and the Perl distribution ... I couldnt find v5.16.0 neither m i able to update the packer as no upgradable packages are available .. Kindly suggest ways to get through this problem ...

Replies are listed 'Best First'.
Re: PAR packer error
by dasgar (Priest) on Dec 31, 2012 at 06:25 UTC

    Which distribution and version of Perl are you using? Based on some info in your post, it kind of looks like you are using ActiveState's 64-bit ActivePerl 5.16.1.

    For 32-bit ActivePerl, I would suggest using PPM to install mingw and dmake. Once those are installed, you can install PAR::Packer directly from cpan (i.e.: cpan install PAR:Packer). For 64-bit ActivePerl, you can also use PPM to install mingw and dmake. However, I think that there's one more gotcha step after that, but can't remember what was the issue there. I think it was something to do with Microsoft's 64-bit DLLs for 64-bit Windows that was the problem, which might also force you to use Microsoft's Visual Studio compiler instead of the 64-bit mingw.

    If you go with Strawberry Perl, both 32-bit and 64-bit versions already come with everything needed to install modules directly from CPAN.

    Also, I personally have not written any scripts that really need the 64-bit stuff (such as 64-bit integers, etc.). So in my case, I've had no issues using 32-bit Perl on both 32-bit and 64-bit Windows. Also, whenever I have taken any of my scripts and used PAR::Packer's pp utility to create a 32-bit executable, that executable worked just fine in 64-Windows. Just thought I'd share that info in case you are not needing the 64-bit stuff.

Re: PAR packer error
by Anonymous Monk on Dec 31, 2012 at 04:58 UTC

    Kindly suggest ways to get throught this problem ...

    Don't use ppm, compile PAR/PAR::Packer yourself, but you knew that already :)

Re: PAR packer error
by reaper9187 (Scribe) on Dec 31, 2012 at 07:24 UTC
    Hi .. Thanks for the quick comments... I'm using the Active Perl v5.16.1 Build 1601(64 bit)... I'm open to experimentation now ...
    My application is not specifically built fr the 64 bit windows and i'm planning to develop it for cross platform implementation, i.e for both 32 bit and 64 bit windows... I haven't used strawberry perl ...Could you please guide me on how to go about it ??? The PAR::Packer i guess compiles the executable based on the platform it is developed upon ( in my case a 64 bit version).. I'll try using minGW meanwhile ...

      "i guess compiles the executable"

      Stop guessing. pp is a packager, not a compiler. Please read the documentation (along with the links provided in this thread) carefully so that you understand what this tool does.

Re: PAR packer error
by reaper9187 (Scribe) on Dec 31, 2012 at 12:29 UTC
    Hi marto ..I'm sorry.. i wasnt very clear in the previous statement .. I wasn't really stressing on the semantics of the statement .. I know it is a packager . what i meant was that the copy of the exe would be specific to the windows 64 platform ..

    I tried cava packager... it seems to create the exe file perfectly .. i can run it on my system .. but shows the error  libgd-2_.dll not found.. "... on a test system..
    so now i'm thinking of automating the process of the module installation ...

    is it possible to automate the entire process of installing modules (local distribution).??? I have a bunch of modules i want the user to install ... but i dont want him to go through much trouble ... I've tried several methods of creating an exe but failed .. so now user would be ready to go and he only needs to install the perl distribution and run the installation script ...

      You've posted here over 50 times, yet you reply to your own posts and not to those who you seem to want to address. Consider reading and understanding PerlMonks for the Absolute Beginner.

      It sounds like cava hasn't packaged a dll that one of the modules you're using (GD) relies on. For that you'd need to read and understand the documentation for the packager you're using. I don't use cava, this is all explained for pp in the documentation and the links you've already been given.

      "I've tried several methods of creating an exe but failed"

      You've provided feedback for cava, nothing else. No examples of how you tried to package this with pp. There's nothing anyone can help you with. Spend the time learning to use the tools you've chosen. Links have been provided. If you have an actual problem you want help with read and understand How do I post a question effectively?.

      Also, your keyboard seems to have a faulty ? key.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1010988]
Approved by dasgar
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2018-12-19 03:17 GMT
Find Nodes?
    Voting Booth?
    How many stories does it take before you've heard them all?

    Results (83 votes). Check out past polls.