prabhakaran
prabhakaran

Reputation: 333

How do I fix "gcc: winrespp.rc: No such file or directory" during compiling PAR::Packer on Cygwin?

I have tried to install PAR::Packer in Cygwin for Windows on a 32 bit machine, so I executed cpan pp. I am facing the following problem.

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

Upvotes: 3

Views: 757

Answers (1)

Sinan Ünür
Sinan Ünür

Reputation: 118148

The problem is in 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;

and, later,

$res_section:
    $rt_cmd
    $res_cmd

Under Cygwin's bash, winres\pp.rc would be interpreted as winrespp.rc instead of winres/pp.rc. The correct way would be

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

etc.

Upvotes: 2

Related Questions