如何在Cygwin上编译PAR :: Packer时修复“gcc:winrespp.rc:没有这样的文件或目录”?

时间:2012-06-01 09:59:20

标签: perl cygwin

我曾尝试在32位计算机上在Cygwin for Windows中安装PAR::Packer,因此我执行了cpan pp。 我面临以下问题。

gcc-4 -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include  -I/usr/lib/perl5/5.14/i686-cygwin-threads-64int/CORE  -DPARL_EXE=\parl.exe\ -O3 main.c windres -F pei-i386 -i winres\pp.rc -o winres\pp.res
gcc: winrespp.rc: No such file or directory
gcc: warning: '-x c' after last input file has no effect
gcc: no input files
windres: preprocessing failed.
Makefile:735: recipe for target ppresource.coff failed
make[1]: *** [ppresource.coff] Error 1
make[1]: Leaving directory /home/prabhakaran.srinivas/.cpan/build/PAR-Packer-1.013-eTAwxL/myldr
Makefile:594: recipe for target subdirs failed
make: *** [subdirs] Error 2
  RSCHUPP/PAR-Packer-1.013.tar.gz
  make -- NOT OK
CPAN: YAML loaded ok (v0.81)
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible

1 个答案:

答案 0 :(得分:2)

问题出在myldr/Makefile.PL

$pre_res = qq(winres\\pp.res);
$rt_cmd = qq(windres -F pei-i386 -i winres\\pp.rc -o $pre_res);
$res_cmd = qq(windres -o ppresource.coff $pre_res);
$res_section = $res;

以及之后的

$res_section:
    $rt_cmd
    $res_cmd

在Cygwin的bash下,winres\pp.rc将被解释为winrespp.rc而不是winres/pp.rc。正确的方法是

$pre_res = catfile(winres => 'pp.res');
$rt_cmd = join ' ' => qw(windres -F pei-i386 -i), catfile(winres => 'pp.rc'), '-o', $pre_res;