Perl and macOS Mojave: Header files not found. Use Perlbrew!

  • Posted on November 29, 2018 at 23:15

Having trouble in CPAN, getting messages like: fatal error: ‘EXTERN.h’ file not found.
Use Perlbrew and all your worries are gone.

$ brew install perl

$ brew link –overwrite perl

After this Perl and CPAN are installed /usr/local/bin:

$ which perl cpan
/usr/local/bin/perl
/usr/local/bin/cpan

 

 

 

2 Comments on Perl and macOS Mojave: Header files not found. Use Perlbrew!

  1. Maarten says:

    I had the “Fatal error: ‘EXTERN.h’ file not found” while installing Perl modules for a locally installed bugzilla instance.

    Installing brew and then brew install perl seemd to much for me. Then I looked further:

    After reading https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035624
    and installing the additional headers from the package <xsl:include href="”/>
    /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

    I successfully compiled new mysql drivers and more XS code without the “missing ‘EXTERN.h'”” error when using the command:

    > /usr/bin/perl install-module.pl Your::Module

    I hope this will help you resolve your probelms as well.

Leave a Reply to KrusjMe Cancel reply