3

我试图在 32 位机器上的 Cygwin for Windows 中安装PAR::Packercpan 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
4

1 回答 1

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;

等等

于 2012-06-01T17:11:40.870 回答