当我运行以下命令从Perl脚本创建可执行文件时:
pp -o process_target_mode_data Process_Target_Mode_Data.pl
我收到以下错误输出:
Perl lib version (5.12.2) doesn't match executable version (v5.12.0) at /home/Neil/ActivePerl-5.12/lib/Config.pm line 50.
Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/Errno.pm line 8.
BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/Errno.pm line 8.
Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/File/Temp.pm line 148.
BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/File/Temp.pm line 148.
Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/Archive/Zip.pm line 14.
BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/Archive/Zip.pm line 14.
Compilation failed in require at -e line 459.
/home/Neil/ActivePerl-5.12/site/bin/pp: Failed to extract a parl from 'PAR::StrippedPARL::Static' to file 'parleNrP2Xi' at /home/Neil/ActivePerl-5.12/site/lib/PAR/Packer.pm line 1172, <DATA> line 1.
有人可以向我解释发生了什么以及如何解决这个问题吗?
信息brian d foy要求:
[bash-3.2][Neil@willy]$ which pp /home/Neil/ActivePerl-5.12/site/bin/pp [bash-3.2][Neil@willy]$ /home/Neil/ActivePerl-5.12/site/bin/pp -o process_target_mode_data Process_Target_Mode_Data.pl Perl lib version (5.12.2) doesn't match executable version (v5.12.0) at /home/Neil/ActivePerl-5.12/lib/Config.pm line 50. Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/Errno.pm line 8. BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/Errno.pm line 8. Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/File/Temp.pm line 148. BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/File/Temp.pm line 148. Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/Archive/Zip.pm line 14. BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/Archive/Zip.pm line 14. Compilation failed in require at -e line 459. /home/Neil/ActivePerl-5.12/site/bin/pp: Failed to extract a parl from 'PAR::StrippedPARL::Static' to file 'parludZfldz' at /home/Neil/ActivePerl-5.12/site/lib/PAR/Packer.pm line 1172, line 1. [bash-3.2][Neil@willy]$ [bash-3.2][Neil@willy]$ /home/Neil/ActivePerl-5.12/bin/cpan -l | grep PAR PAR 1.002 PAR::Dist 0.47 PAR::Heavy 0.12 PAR::Filter 0.03 PAR::SetupTemp 1.002 PAR::SetupProgname 1.002 PAR::Packer 1.006 PAR::StrippedPARL::Dynamic 0.958 PAR::StrippedPARL::Static 0.958 PAR::StrippedPARL::Base 0.975 PAR::Filter::Bytecode undef PAR::Filter::Bleach undef PAR::Filter::Obfuscate undef PAR::Filter::PatchContent undef PAR::Filter::PodStrip undef App::Packer::PAR 0.91
答案 0 :(得分:3)
Perl lib版本(5.12.2)与可执行版本(v5.12.0)不匹配
Perl安装的某些部分与其他部分版本不同。更具体地说,如果查看/home/Neil/ActivePerl-5.12/lib/Config.pm
第50行,您将看到正在执行的Perl版本(即5.12.0)与正在使用的Config.pm库的版本进行明确比较( 5.12.2)。
如果您执行ActivePerl 5.12.2的新安装(将所有组件升级到同一版本),则此错误应该消失。
答案 1 :(得分:3)
我有同样的问题。我从Activestate Perl Package Manager(PPM)安装了PAR :: Packer。如上面的一个回复中所述,perl和pp二进制文件之间存在版本不匹配。以下是我修复它的方法:
cpan install PAR::Packer
这将从CPAN下载,编译和安装软件包。如果需要,也将下载MinGW编译器工具链。整个过程可能需要一段时间才能减慢cpu。
答案 2 :(得分:2)
找到pp
的位置,然后找出其版本。我敢打赌它早先的安装就剩下了。确保您的新版Perl具有PAR。
您还可以尝试指定要使用的特定pp
的位置,以便准确了解您正在使用的内容:
$ /full/path/to/5.12.2/pp ...
答案 3 :(得分:0)
转到 perl/lib/Config.pm 并更改行中的条件:
die "$0: Perl lib version (5.32.0) doesn't match executable '$^X' version ($])" unless $^V;
到
die "$1: Perl lib version (5.32.1) doesn't match executable '$^X' version ($])" unless $^V;
和下一行
$^V eq 5.32.0 or die sprintf "%s: Perl lib version (5.32.0) doesn't match executable '$^X' version (%vd)", $0, $^V;
到
$^V eq 5.32.1 or die sprintf "%s: Perl lib version (5.32.1) doesn't match executable '$^X' version (%vd)", $0, $^V;
这对我有用,至少它不会抱怨......是的,我知道,PERL 和 Python 都被搞砸了。