Perl extension installation - unable to run nmake

2019-07-21 16:25发布

问题:

I am trying to install a module using cpan on XAMPP. I am running Windows 7.

Immediately after this prompt is given:

CPAN.pm: Going to build J/JE/JESSE/HTTP-Server-Simple-0.43.tar.gz

It gives the prompt that "The required nmake executable file is not found, and attempts to fetch it.

After this, a popup window appears stating the the program "\??\c:\xampp\perl\bin\Nmake15.exe can not run due to incompatibility with 64 bit versions of windows.

I downloaded VC++ and copied the make.exe from that install into my perl/bin to replace the original make.exe. This still didn't work. Any idea how I can get installations to work with CPAN?

回答1:

XAMPP comes with a crippled Perl mostly due to the "Apache Friends" being clueless morons. I suggest installing Strawberry Perl additionally, then using that installation from your Perl programs. Module installation in Strawberry goes the usual straight way.



回答2:

Had the same problem that the poster, using XAMPP too, and did the following to be able to install modules on windows 7 - 64 bits

Moreover, with this trick you don't have to change path to perl on your perl scripts in windows that were made for most linux servers, this is, keeping #!/usr/bin/perl and use them just from XAMPP locally in your windows box.

  • Just as daxim said, get away from XAMPP included perl.
  • Download ActivePerl from ActiveState (choose your 32 or 64 bit flavor).
  • The package manager GUI is just great (make sure to select View -> All packages, to search..)
  • Install the packages you need
  • By default ActivePerl installs on C:\perl (or C:\Perl64)
  • Use the tool 'reloc_perl' inside "bin" directory to relocate your perl installation to \usr... issuing the following command from "bin" folder: reloc_perl \usr
  • Now you can just use #!/usr/bin/perl on your perl scripts using ActivePerl
  • If you want to add modules later, you'll have to delete \usr and reloc again, since they get installed on the original directory (which is not deleted by default)


回答3:

What @daxim said was true. Use Strawberry Perl 5.14 from http://strawberryperl.com/releases.html. Since a lot of modules were implemented up to that point, you can easily ppm without any needs to add repos.