Search code examples
perlcompiler-errorsstrawberry-perl

Strawberry Perl - Error Message: This package requires a C compiler


I have Strawberry Perl May 2016 (5.24.0) 32bit PortableZIP edition. I have only unzipped it; there are no changes otherwise.

When i want to install modules with cpan i got the follow error:

C:\Fhem\perl\bin>cpan -i Net::SSLeay
Loading internal null logger. Install Log::Log4perl for logging messages
CPAN: CPAN::SQLite loaded ok (v0.211)
Database was generated on Tue, 13 Dec 2016 13:41:47 GMT

Running install for module 'Net::SSLeay'
CPAN: LWP::UserAgent loaded ok (v6.15)
CPAN: Time::HiRes loaded ok (v1.9733)
Fetching with LWP:
http://cpan.strawberryperl.com/authors/id/M/MI/MIKEM/Net-SSLeay-1.78.tar.gz
CPAN: YAML::XS loaded ok (v0.62)
CPAN: Digest::SHA loaded ok (v5.95)
Fetching with LWP:
http://cpan.strawberryperl.com/authors/id/M/MI/MIKEM/CHECKSUMS
CPAN: Compress::Zlib loaded ok (v2.069)
Checksum for C:\Fhem\cpan\sources\authors\id\M\MI\MIKEM\Net-SSLeay-1.78.tar.gz ok
CPAN: Archive::Tar loaded ok (v2.06)
CPAN: File::Temp loaded ok (v0.2304)
CPAN: CPAN::Meta::Requirements loaded ok (v2.140)
CPAN: Parse::CPAN::Meta loaded ok (v1.4417)
CPAN: CPAN::Meta loaded ok (v2.150005)
CPAN: Module::CoreList loaded ok (v5.20160507)
Configuring M/MI/MIKEM/Net-SSLeay-1.78.tar.gz with Makefile.PL
Unresolvable missing external dependency.
This package requires a C compiler.
NA: Unable to build distribution on this platform.
No 'Makefile' created  MIKEM/Net-SSLeay-1.78.tar.gz
  C:\Fhem\perl\bin\perl.exe Makefile.PL -- NOT OK
Stopping: 'install' failed for 'Net::SSLeay'.

Seems to be no compiler found. What must I do to fix this?


Solution

  • Presumably you are running perl and cpan directly from the command prompt?

    You should read the contents of the README.txt file in the distribution, where it tells you to run c:\myperl\portableshell.bat before using any of the utilities

    I hope it's clear that you must change c:\myperl to the folder where you unzipped the distribution

    There are three subdirectories of the unzipped volume which need to be in the PATH before everything will work, and the .bat file will set those up temporarily for you. If you want something more permanent then the README.txt file explains how to do that, but you should probably run a proper installed version instead