1

I'm trying to install the YAML::Syck module (I'm actually trying to install Date::Manip, this is just a dependency), but it fails with the following message:

This module requires a C compiler at Makefile.PL line 38.

This happens whether I try to install using CPAN or if I try to download the packages and install manually.

I have gcc installed and on my PATH, I can access it from the same CYGWIN shell window that I'm trying to use to install YAML::Syck.

3 Answers 3

8

When looking for a C compiler, ExtUtils::MakeMaker and Module::Build don't necessarily look for gcc in your PATH, but query your perl's configuration for the C compiler it has been built with and expects it to be available for building Perl extensions as well.

On my system, it will look for cc in PATH, as per

$ perl -MConfig -E'say $Config{cc}'
cc
2
  • 1
    s/don't look for/don't necessarily look for/
    – ikegami
    Apr 14, 2011 at 19:29
  • 1
    Shorter: perl -V:cc gcc-4
    – rurban
    Apr 3, 2013 at 13:48
3

I've had trouble in the past getting everything to "just work" with cygwin, when it comes to compiling modules. You might want to take a look at Strawberry Perl, which is a Windows Perl distribution that comes bundled with all of the components needed for compilation of XS modules. I haven't personally tried to install YAML::Syck with it, but I have installed many other XS modules without incident.

Once it is installed and in your path (usually automatically), you should be able to run cpan from the Windows command prompt to install the module.

1

Maintainer speaking

The better forum to ask is the cygwin mailinglist. There you will find the same questions being asked again and again, we can point to the messages, and the maintainers are present. The quality of the answers will be much better. The official latest perl announcement was http://sourceware.org/ml/cygwin-announce/2012-07/msg00011.html

perl used to bundle most useful modules for CPAN and Testing with the core perl. With the latest 5.14 package the useful modules were moved to the seperate package perl_vendor. The dependencies to be able to compile modules by your own via cpan are not included. You'll need make and gcc-4 at least. See /usr/share/doc/Cygwin/perl.README for the package specific README.

YAML::Syck is considered broken and unmaintained (*_why* left), please try to use a better YAML package, like YAML or YAML::XS, written by the inventor and author of YAML itself (ingy). Date::Manip does not require YAML::Syck. cpan does like to have a YAML modules, but prefers YAML::XS.

You'll find out that you'll be able to install much more packages with cygwin perl than with strawberry perl (=mingw).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.