Strawberry perl CPAN dmake will not build

3k Views Asked by At

I am having a problem installing CPAN modules using strawberry perl 5.16.2.2 64 bit and later versions. When installing from CPAN dmake fails to build the module with the following error:

dmake.exe:  Error executing 'C:\Windows\system32\cmd.exe; /c C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e mkpath -- blib\lib\MIME': No such file or directory
dmake.exe:  Error code -1, while making 'blib\lib\MIME\.exists'

After extensive research I have found that the fix for the problem is to add SHELL=cmd.exe to the top of the dmake Makefile file produced by perl Makefile.PL and then the module can be installed using

dmake 
dmake install

The problem is that no CPAN modules will install automatically without attempting a CPAN install, editing the Makefile and running dmake manually in the cpan/build directory. Using an environment variable SHELL=cmd.exe or MAKESHELL=cmd.exe does NOT work, as the build does not run correctly if used.

Does anyone know a fix for why my Windows 7 64 bit machine has this problem?

Is there is any configuration for cpan or some other technique so that I dont have to manually edit and run the dmake makefile for every CPAN module for my strawberry perl installation?

2

There are 2 best solutions below

0
On

It seems that your path is the issue:

blib\lib\MIME

Relative paths in MS Windows start with a ".\"

.\blib\lib\MIME

I'd recommend you to try it with the absolute path, first. If it works, try the relative one.

0
On

Did you already have dmake (MinGW) installed? For me this works just fine on a standard x64 bit Windows installation.

Also, is your perl directory in path? If you don't you might need to restart your computer first before installing CPAN modules (really!).