“Fatal error: 'EXTERN.h' file not found” while installing Perl modules










3















While trying to install Perl modules like JSON::XS or YAML::XS, i receive the same error:




XS.xs:1:10: fatal error: 'EXTERN.h' file not found




I use MacBook, xCode is up to date, everything else that could help is up to date too.



Pls send help.










share|improve this question

















  • 2





    Sounds like your Perl installation is incomplete. It's missing some headers.

    – melpomene
    Oct 6 '18 at 19:06











  • I think this can happen when certain libraries are updated after installing Perl. Try reinstalling Perl?

    – Grinnz
    Oct 6 '18 at 23:48











  • Like @melpomene said, you are missing key parts of Perl itself. Lots of linux distros only install parts Perl by default, and leave it to you to install the left-out bits as needed using their package manager (apt / yum). It might be the same for MacBooks?

    – ikegami
    Oct 7 '18 at 9:53
















3















While trying to install Perl modules like JSON::XS or YAML::XS, i receive the same error:




XS.xs:1:10: fatal error: 'EXTERN.h' file not found




I use MacBook, xCode is up to date, everything else that could help is up to date too.



Pls send help.










share|improve this question

















  • 2





    Sounds like your Perl installation is incomplete. It's missing some headers.

    – melpomene
    Oct 6 '18 at 19:06











  • I think this can happen when certain libraries are updated after installing Perl. Try reinstalling Perl?

    – Grinnz
    Oct 6 '18 at 23:48











  • Like @melpomene said, you are missing key parts of Perl itself. Lots of linux distros only install parts Perl by default, and leave it to you to install the left-out bits as needed using their package manager (apt / yum). It might be the same for MacBooks?

    – ikegami
    Oct 7 '18 at 9:53














3












3








3








While trying to install Perl modules like JSON::XS or YAML::XS, i receive the same error:




XS.xs:1:10: fatal error: 'EXTERN.h' file not found




I use MacBook, xCode is up to date, everything else that could help is up to date too.



Pls send help.










share|improve this question














While trying to install Perl modules like JSON::XS or YAML::XS, i receive the same error:




XS.xs:1:10: fatal error: 'EXTERN.h' file not found




I use MacBook, xCode is up to date, everything else that could help is up to date too.



Pls send help.







json perl cpan






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 6 '18 at 18:49









YozzYozz

113




113







  • 2





    Sounds like your Perl installation is incomplete. It's missing some headers.

    – melpomene
    Oct 6 '18 at 19:06











  • I think this can happen when certain libraries are updated after installing Perl. Try reinstalling Perl?

    – Grinnz
    Oct 6 '18 at 23:48











  • Like @melpomene said, you are missing key parts of Perl itself. Lots of linux distros only install parts Perl by default, and leave it to you to install the left-out bits as needed using their package manager (apt / yum). It might be the same for MacBooks?

    – ikegami
    Oct 7 '18 at 9:53













  • 2





    Sounds like your Perl installation is incomplete. It's missing some headers.

    – melpomene
    Oct 6 '18 at 19:06











  • I think this can happen when certain libraries are updated after installing Perl. Try reinstalling Perl?

    – Grinnz
    Oct 6 '18 at 23:48











  • Like @melpomene said, you are missing key parts of Perl itself. Lots of linux distros only install parts Perl by default, and leave it to you to install the left-out bits as needed using their package manager (apt / yum). It might be the same for MacBooks?

    – ikegami
    Oct 7 '18 at 9:53








2




2





Sounds like your Perl installation is incomplete. It's missing some headers.

– melpomene
Oct 6 '18 at 19:06





Sounds like your Perl installation is incomplete. It's missing some headers.

– melpomene
Oct 6 '18 at 19:06













I think this can happen when certain libraries are updated after installing Perl. Try reinstalling Perl?

– Grinnz
Oct 6 '18 at 23:48





I think this can happen when certain libraries are updated after installing Perl. Try reinstalling Perl?

– Grinnz
Oct 6 '18 at 23:48













Like @melpomene said, you are missing key parts of Perl itself. Lots of linux distros only install parts Perl by default, and leave it to you to install the left-out bits as needed using their package manager (apt / yum). It might be the same for MacBooks?

– ikegami
Oct 7 '18 at 9:53






Like @melpomene said, you are missing key parts of Perl itself. Lots of linux distros only install parts Perl by default, and leave it to you to install the left-out bits as needed using their package manager (apt / yum). It might be the same for MacBooks?

– ikegami
Oct 7 '18 at 9:53













1 Answer
1






active

oldest

votes


















3














Since OS X El Capitan, Apple introduced System Integrity Protection which restricts writing to /usr/lib /usr/bin and other sensitive directories (even to root or sudo user) that are used by the installation of Perl bundled with the Operating System. This can cause issues when it comes to installing new modules and also if trying to install XS modules ( those linked to external C libraries ).



For this reason you should not consider the default Perl installation as a working development environment, especially if you are installing custom modules.



Check out this thread on PM and others. I had since El-Capitan managed to solve this before by manually building from tarball and adding a few params or environment variables to set the paths believing that it would be best to retain use of the system Perl but this is not the way to go. This makes your environment difficult to build but also brittle and sensitive to OS updates that may either break things in many different ways.



The best practice seems to be starting with a Perl using brew install perl and work in this environment, remembering to setup your bash_profile as directed by the installer.



Also worth remembering to do a brew link perl. If you receive warnings about this clobbering what looks like system Perl libraries don't worry - these are likely modules that were installed by you over the top and it will cause you less trouble to link over these. If you have concerns, make a note of which module installs will be cleared and re-install them once your environment is configured ( ie your module installer approach is configured using cpanm or sticking with the old perl -MCPAN -e shell etc)



This new Perl setup from brew eliminates the need to continuing running sudo which adds another layer of things that can go wrong as environment variables don't follow through and permission conflicts arise etc.



Finally to simplify package/module installation I suggest doing a brew install cpanminus. If you had previously already installed this, you can ensure the paths etc are configured by doing a brew reinstall cpanminus



If you want to take it another step further then you can install perlbrew as well which will give you the ability to run multiple versions of Perl as your user and configure these with their own libs and modules which can be very useful particularly if aligning with your production environment for testing etc.



One problem you may face if moving from system Perl to this kind of approach is needing to deal with any hangovers from installing things with sudo. It wis worth taking a little time to get all this set up right though and your issues going forward will be greatly reduced and you won't be left with that nagging feeling that you don't want to change anything for fear of it all breaking.



I have also come across a Perl Blog Article that suggests a fix for XS issues with perlbrew on Mojave



This Gist described updating your cpan shell install root though this shouldn't be necessary unless your cpan is stuck in an old config after taking steps above.



I've also raised this as a new issue on PerlMonks






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52682304%2ffatal-error-extern-h-file-not-found-while-installing-perl-modules%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    Since OS X El Capitan, Apple introduced System Integrity Protection which restricts writing to /usr/lib /usr/bin and other sensitive directories (even to root or sudo user) that are used by the installation of Perl bundled with the Operating System. This can cause issues when it comes to installing new modules and also if trying to install XS modules ( those linked to external C libraries ).



    For this reason you should not consider the default Perl installation as a working development environment, especially if you are installing custom modules.



    Check out this thread on PM and others. I had since El-Capitan managed to solve this before by manually building from tarball and adding a few params or environment variables to set the paths believing that it would be best to retain use of the system Perl but this is not the way to go. This makes your environment difficult to build but also brittle and sensitive to OS updates that may either break things in many different ways.



    The best practice seems to be starting with a Perl using brew install perl and work in this environment, remembering to setup your bash_profile as directed by the installer.



    Also worth remembering to do a brew link perl. If you receive warnings about this clobbering what looks like system Perl libraries don't worry - these are likely modules that were installed by you over the top and it will cause you less trouble to link over these. If you have concerns, make a note of which module installs will be cleared and re-install them once your environment is configured ( ie your module installer approach is configured using cpanm or sticking with the old perl -MCPAN -e shell etc)



    This new Perl setup from brew eliminates the need to continuing running sudo which adds another layer of things that can go wrong as environment variables don't follow through and permission conflicts arise etc.



    Finally to simplify package/module installation I suggest doing a brew install cpanminus. If you had previously already installed this, you can ensure the paths etc are configured by doing a brew reinstall cpanminus



    If you want to take it another step further then you can install perlbrew as well which will give you the ability to run multiple versions of Perl as your user and configure these with their own libs and modules which can be very useful particularly if aligning with your production environment for testing etc.



    One problem you may face if moving from system Perl to this kind of approach is needing to deal with any hangovers from installing things with sudo. It wis worth taking a little time to get all this set up right though and your issues going forward will be greatly reduced and you won't be left with that nagging feeling that you don't want to change anything for fear of it all breaking.



    I have also come across a Perl Blog Article that suggests a fix for XS issues with perlbrew on Mojave



    This Gist described updating your cpan shell install root though this shouldn't be necessary unless your cpan is stuck in an old config after taking steps above.



    I've also raised this as a new issue on PerlMonks






    share|improve this answer





























      3














      Since OS X El Capitan, Apple introduced System Integrity Protection which restricts writing to /usr/lib /usr/bin and other sensitive directories (even to root or sudo user) that are used by the installation of Perl bundled with the Operating System. This can cause issues when it comes to installing new modules and also if trying to install XS modules ( those linked to external C libraries ).



      For this reason you should not consider the default Perl installation as a working development environment, especially if you are installing custom modules.



      Check out this thread on PM and others. I had since El-Capitan managed to solve this before by manually building from tarball and adding a few params or environment variables to set the paths believing that it would be best to retain use of the system Perl but this is not the way to go. This makes your environment difficult to build but also brittle and sensitive to OS updates that may either break things in many different ways.



      The best practice seems to be starting with a Perl using brew install perl and work in this environment, remembering to setup your bash_profile as directed by the installer.



      Also worth remembering to do a brew link perl. If you receive warnings about this clobbering what looks like system Perl libraries don't worry - these are likely modules that were installed by you over the top and it will cause you less trouble to link over these. If you have concerns, make a note of which module installs will be cleared and re-install them once your environment is configured ( ie your module installer approach is configured using cpanm or sticking with the old perl -MCPAN -e shell etc)



      This new Perl setup from brew eliminates the need to continuing running sudo which adds another layer of things that can go wrong as environment variables don't follow through and permission conflicts arise etc.



      Finally to simplify package/module installation I suggest doing a brew install cpanminus. If you had previously already installed this, you can ensure the paths etc are configured by doing a brew reinstall cpanminus



      If you want to take it another step further then you can install perlbrew as well which will give you the ability to run multiple versions of Perl as your user and configure these with their own libs and modules which can be very useful particularly if aligning with your production environment for testing etc.



      One problem you may face if moving from system Perl to this kind of approach is needing to deal with any hangovers from installing things with sudo. It wis worth taking a little time to get all this set up right though and your issues going forward will be greatly reduced and you won't be left with that nagging feeling that you don't want to change anything for fear of it all breaking.



      I have also come across a Perl Blog Article that suggests a fix for XS issues with perlbrew on Mojave



      This Gist described updating your cpan shell install root though this shouldn't be necessary unless your cpan is stuck in an old config after taking steps above.



      I've also raised this as a new issue on PerlMonks






      share|improve this answer



























        3












        3








        3







        Since OS X El Capitan, Apple introduced System Integrity Protection which restricts writing to /usr/lib /usr/bin and other sensitive directories (even to root or sudo user) that are used by the installation of Perl bundled with the Operating System. This can cause issues when it comes to installing new modules and also if trying to install XS modules ( those linked to external C libraries ).



        For this reason you should not consider the default Perl installation as a working development environment, especially if you are installing custom modules.



        Check out this thread on PM and others. I had since El-Capitan managed to solve this before by manually building from tarball and adding a few params or environment variables to set the paths believing that it would be best to retain use of the system Perl but this is not the way to go. This makes your environment difficult to build but also brittle and sensitive to OS updates that may either break things in many different ways.



        The best practice seems to be starting with a Perl using brew install perl and work in this environment, remembering to setup your bash_profile as directed by the installer.



        Also worth remembering to do a brew link perl. If you receive warnings about this clobbering what looks like system Perl libraries don't worry - these are likely modules that were installed by you over the top and it will cause you less trouble to link over these. If you have concerns, make a note of which module installs will be cleared and re-install them once your environment is configured ( ie your module installer approach is configured using cpanm or sticking with the old perl -MCPAN -e shell etc)



        This new Perl setup from brew eliminates the need to continuing running sudo which adds another layer of things that can go wrong as environment variables don't follow through and permission conflicts arise etc.



        Finally to simplify package/module installation I suggest doing a brew install cpanminus. If you had previously already installed this, you can ensure the paths etc are configured by doing a brew reinstall cpanminus



        If you want to take it another step further then you can install perlbrew as well which will give you the ability to run multiple versions of Perl as your user and configure these with their own libs and modules which can be very useful particularly if aligning with your production environment for testing etc.



        One problem you may face if moving from system Perl to this kind of approach is needing to deal with any hangovers from installing things with sudo. It wis worth taking a little time to get all this set up right though and your issues going forward will be greatly reduced and you won't be left with that nagging feeling that you don't want to change anything for fear of it all breaking.



        I have also come across a Perl Blog Article that suggests a fix for XS issues with perlbrew on Mojave



        This Gist described updating your cpan shell install root though this shouldn't be necessary unless your cpan is stuck in an old config after taking steps above.



        I've also raised this as a new issue on PerlMonks






        share|improve this answer















        Since OS X El Capitan, Apple introduced System Integrity Protection which restricts writing to /usr/lib /usr/bin and other sensitive directories (even to root or sudo user) that are used by the installation of Perl bundled with the Operating System. This can cause issues when it comes to installing new modules and also if trying to install XS modules ( those linked to external C libraries ).



        For this reason you should not consider the default Perl installation as a working development environment, especially if you are installing custom modules.



        Check out this thread on PM and others. I had since El-Capitan managed to solve this before by manually building from tarball and adding a few params or environment variables to set the paths believing that it would be best to retain use of the system Perl but this is not the way to go. This makes your environment difficult to build but also brittle and sensitive to OS updates that may either break things in many different ways.



        The best practice seems to be starting with a Perl using brew install perl and work in this environment, remembering to setup your bash_profile as directed by the installer.



        Also worth remembering to do a brew link perl. If you receive warnings about this clobbering what looks like system Perl libraries don't worry - these are likely modules that were installed by you over the top and it will cause you less trouble to link over these. If you have concerns, make a note of which module installs will be cleared and re-install them once your environment is configured ( ie your module installer approach is configured using cpanm or sticking with the old perl -MCPAN -e shell etc)



        This new Perl setup from brew eliminates the need to continuing running sudo which adds another layer of things that can go wrong as environment variables don't follow through and permission conflicts arise etc.



        Finally to simplify package/module installation I suggest doing a brew install cpanminus. If you had previously already installed this, you can ensure the paths etc are configured by doing a brew reinstall cpanminus



        If you want to take it another step further then you can install perlbrew as well which will give you the ability to run multiple versions of Perl as your user and configure these with their own libs and modules which can be very useful particularly if aligning with your production environment for testing etc.



        One problem you may face if moving from system Perl to this kind of approach is needing to deal with any hangovers from installing things with sudo. It wis worth taking a little time to get all this set up right though and your issues going forward will be greatly reduced and you won't be left with that nagging feeling that you don't want to change anything for fear of it all breaking.



        I have also come across a Perl Blog Article that suggests a fix for XS issues with perlbrew on Mojave



        This Gist described updating your cpan shell install root though this shouldn't be necessary unless your cpan is stuck in an old config after taking steps above.



        I've also raised this as a new issue on PerlMonks







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 13 '18 at 3:34

























        answered Oct 25 '18 at 20:54









        Peter ScottPeter Scott

        928715




        928715



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52682304%2ffatal-error-extern-h-file-not-found-while-installing-perl-modules%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Use pre created SQLite database for Android project in kotlin

            Darth Vader #20

            Ondo