gcc not finding header file though its path has been included with -I












6















I'm trying to install a module (Package::Stash::XS) via cpanm, but the installation is failing due to a gcc error. The command



gcc -c    -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fno-strict-aliasing -pipe -fstack-protector -DUSEIMPORTLIB -O3    -DVERSION="0.28"  -DXS_VERSION="0.28"  "-I/usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE"   XS.c


fails with the error:



XS.xs:1:20: fatal error: EXTERN.h: No such file or directory
compilation terminated.


at the line



#line 1 "XS.xs"
#include "EXTERN.h"


However, the file EXTERN.h does exist in the -I included /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE :



$ ls /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/E*
/usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/EXTERN.h


What could the issue be, and how can I make the compilation successful? I've tried changing the -I to -iquote (though gcc manual does say double quoted includes also eventually use -I), but that doesn't help. My first thought was it was a permission issue, but this is Cygwin and cpanm is running as me and I do have read access to EXTERN.h and exec access on the CORE directory.










share|improve this question

























  • I guess gcc is calling another programs and not passing the -I parameters to them...

    – golimar
    Sep 19 '13 at 8:10
















6















I'm trying to install a module (Package::Stash::XS) via cpanm, but the installation is failing due to a gcc error. The command



gcc -c    -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fno-strict-aliasing -pipe -fstack-protector -DUSEIMPORTLIB -O3    -DVERSION="0.28"  -DXS_VERSION="0.28"  "-I/usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE"   XS.c


fails with the error:



XS.xs:1:20: fatal error: EXTERN.h: No such file or directory
compilation terminated.


at the line



#line 1 "XS.xs"
#include "EXTERN.h"


However, the file EXTERN.h does exist in the -I included /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE :



$ ls /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/E*
/usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/EXTERN.h


What could the issue be, and how can I make the compilation successful? I've tried changing the -I to -iquote (though gcc manual does say double quoted includes also eventually use -I), but that doesn't help. My first thought was it was a permission issue, but this is Cygwin and cpanm is running as me and I do have read access to EXTERN.h and exec access on the CORE directory.










share|improve this question

























  • I guess gcc is calling another programs and not passing the -I parameters to them...

    – golimar
    Sep 19 '13 at 8:10














6












6








6


3






I'm trying to install a module (Package::Stash::XS) via cpanm, but the installation is failing due to a gcc error. The command



gcc -c    -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fno-strict-aliasing -pipe -fstack-protector -DUSEIMPORTLIB -O3    -DVERSION="0.28"  -DXS_VERSION="0.28"  "-I/usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE"   XS.c


fails with the error:



XS.xs:1:20: fatal error: EXTERN.h: No such file or directory
compilation terminated.


at the line



#line 1 "XS.xs"
#include "EXTERN.h"


However, the file EXTERN.h does exist in the -I included /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE :



$ ls /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/E*
/usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/EXTERN.h


What could the issue be, and how can I make the compilation successful? I've tried changing the -I to -iquote (though gcc manual does say double quoted includes also eventually use -I), but that doesn't help. My first thought was it was a permission issue, but this is Cygwin and cpanm is running as me and I do have read access to EXTERN.h and exec access on the CORE directory.










share|improve this question
















I'm trying to install a module (Package::Stash::XS) via cpanm, but the installation is failing due to a gcc error. The command



gcc -c    -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fno-strict-aliasing -pipe -fstack-protector -DUSEIMPORTLIB -O3    -DVERSION="0.28"  -DXS_VERSION="0.28"  "-I/usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE"   XS.c


fails with the error:



XS.xs:1:20: fatal error: EXTERN.h: No such file or directory
compilation terminated.


at the line



#line 1 "XS.xs"
#include "EXTERN.h"


However, the file EXTERN.h does exist in the -I included /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE :



$ ls /usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/E*
/usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE/EXTERN.h


What could the issue be, and how can I make the compilation successful? I've tried changing the -I to -iquote (though gcc manual does say double quoted includes also eventually use -I), but that doesn't help. My first thought was it was a permission issue, but this is Cygwin and cpanm is running as me and I do have read access to EXTERN.h and exec access on the CORE directory.







cygwin perl gcc cpan






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 19 '13 at 8:28







sundar

















asked Sep 19 '13 at 7:13









sundarsundar

71941634




71941634













  • I guess gcc is calling another programs and not passing the -I parameters to them...

    – golimar
    Sep 19 '13 at 8:10



















  • I guess gcc is calling another programs and not passing the -I parameters to them...

    – golimar
    Sep 19 '13 at 8:10

















I guess gcc is calling another programs and not passing the -I parameters to them...

– golimar
Sep 19 '13 at 8:10





I guess gcc is calling another programs and not passing the -I parameters to them...

– golimar
Sep 19 '13 at 8:10










2 Answers
2






active

oldest

votes


















10














This was fixed by installing libcrypt-devel.



Then everything worked just fine... So problem solved!



This explains it better: Re: Difficult compiling Package::Stash::XS






share|improve this answer

































    5














    Ok, I believe I've found the issue. I'm running this in Cygwin as mentioned, and it appears Cygwin was trying to use Windows strawberry Perl's gcc since it's own gcc wasn't installed! The Windows gcc probably had problems with a Cygwin style path, hence the weird error. I've now installed Cygwin's gcc and this problem is gone. It complained next about a <crypt.h>, that too was solved by installing libcrypt-devel from the Cygwin setup dialog.






    share|improve this answer





















    • 2





      Note that it is not useful as a user to read "installing a few crypt-related libraries". It is useful to read "installing libcrypt-devel"

      – Rob Hall
      Jun 24 '14 at 14:33








    • 2





      @RobHall Thanks for mentioning the library. I must have written it that way because I just went out and installed whatever had "crypt" in the name, and didn't know specifically which one helped.

      – sundar
      Jun 25 '14 at 15:37











    • Cygwins gcc-g++ package had to be installed in my case (along with gcc-core and make)

      – Kjetil S.
      Nov 14 '17 at 11:27













    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    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%2fsuperuser.com%2fquestions%2f647400%2fgcc-not-finding-header-file-though-its-path-has-been-included-with-i%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    10














    This was fixed by installing libcrypt-devel.



    Then everything worked just fine... So problem solved!



    This explains it better: Re: Difficult compiling Package::Stash::XS






    share|improve this answer






























      10














      This was fixed by installing libcrypt-devel.



      Then everything worked just fine... So problem solved!



      This explains it better: Re: Difficult compiling Package::Stash::XS






      share|improve this answer




























        10












        10








        10







        This was fixed by installing libcrypt-devel.



        Then everything worked just fine... So problem solved!



        This explains it better: Re: Difficult compiling Package::Stash::XS






        share|improve this answer















        This was fixed by installing libcrypt-devel.



        Then everything worked just fine... So problem solved!



        This explains it better: Re: Difficult compiling Package::Stash::XS







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 2 '14 at 13:37









        Kevin Panko

        5,929113648




        5,929113648










        answered Apr 2 '14 at 12:20









        TuAmigoTuAmigo

        10112




        10112

























            5














            Ok, I believe I've found the issue. I'm running this in Cygwin as mentioned, and it appears Cygwin was trying to use Windows strawberry Perl's gcc since it's own gcc wasn't installed! The Windows gcc probably had problems with a Cygwin style path, hence the weird error. I've now installed Cygwin's gcc and this problem is gone. It complained next about a <crypt.h>, that too was solved by installing libcrypt-devel from the Cygwin setup dialog.






            share|improve this answer





















            • 2





              Note that it is not useful as a user to read "installing a few crypt-related libraries". It is useful to read "installing libcrypt-devel"

              – Rob Hall
              Jun 24 '14 at 14:33








            • 2





              @RobHall Thanks for mentioning the library. I must have written it that way because I just went out and installed whatever had "crypt" in the name, and didn't know specifically which one helped.

              – sundar
              Jun 25 '14 at 15:37











            • Cygwins gcc-g++ package had to be installed in my case (along with gcc-core and make)

              – Kjetil S.
              Nov 14 '17 at 11:27


















            5














            Ok, I believe I've found the issue. I'm running this in Cygwin as mentioned, and it appears Cygwin was trying to use Windows strawberry Perl's gcc since it's own gcc wasn't installed! The Windows gcc probably had problems with a Cygwin style path, hence the weird error. I've now installed Cygwin's gcc and this problem is gone. It complained next about a <crypt.h>, that too was solved by installing libcrypt-devel from the Cygwin setup dialog.






            share|improve this answer





















            • 2





              Note that it is not useful as a user to read "installing a few crypt-related libraries". It is useful to read "installing libcrypt-devel"

              – Rob Hall
              Jun 24 '14 at 14:33








            • 2





              @RobHall Thanks for mentioning the library. I must have written it that way because I just went out and installed whatever had "crypt" in the name, and didn't know specifically which one helped.

              – sundar
              Jun 25 '14 at 15:37











            • Cygwins gcc-g++ package had to be installed in my case (along with gcc-core and make)

              – Kjetil S.
              Nov 14 '17 at 11:27
















            5












            5








            5







            Ok, I believe I've found the issue. I'm running this in Cygwin as mentioned, and it appears Cygwin was trying to use Windows strawberry Perl's gcc since it's own gcc wasn't installed! The Windows gcc probably had problems with a Cygwin style path, hence the weird error. I've now installed Cygwin's gcc and this problem is gone. It complained next about a <crypt.h>, that too was solved by installing libcrypt-devel from the Cygwin setup dialog.






            share|improve this answer















            Ok, I believe I've found the issue. I'm running this in Cygwin as mentioned, and it appears Cygwin was trying to use Windows strawberry Perl's gcc since it's own gcc wasn't installed! The Windows gcc probably had problems with a Cygwin style path, hence the weird error. I've now installed Cygwin's gcc and this problem is gone. It complained next about a <crypt.h>, that too was solved by installing libcrypt-devel from the Cygwin setup dialog.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Feb 6 at 17:39









            cxw

            1,21411023




            1,21411023










            answered Sep 20 '13 at 2:58









            sundarsundar

            71941634




            71941634








            • 2





              Note that it is not useful as a user to read "installing a few crypt-related libraries". It is useful to read "installing libcrypt-devel"

              – Rob Hall
              Jun 24 '14 at 14:33








            • 2





              @RobHall Thanks for mentioning the library. I must have written it that way because I just went out and installed whatever had "crypt" in the name, and didn't know specifically which one helped.

              – sundar
              Jun 25 '14 at 15:37











            • Cygwins gcc-g++ package had to be installed in my case (along with gcc-core and make)

              – Kjetil S.
              Nov 14 '17 at 11:27
















            • 2





              Note that it is not useful as a user to read "installing a few crypt-related libraries". It is useful to read "installing libcrypt-devel"

              – Rob Hall
              Jun 24 '14 at 14:33








            • 2





              @RobHall Thanks for mentioning the library. I must have written it that way because I just went out and installed whatever had "crypt" in the name, and didn't know specifically which one helped.

              – sundar
              Jun 25 '14 at 15:37











            • Cygwins gcc-g++ package had to be installed in my case (along with gcc-core and make)

              – Kjetil S.
              Nov 14 '17 at 11:27










            2




            2





            Note that it is not useful as a user to read "installing a few crypt-related libraries". It is useful to read "installing libcrypt-devel"

            – Rob Hall
            Jun 24 '14 at 14:33







            Note that it is not useful as a user to read "installing a few crypt-related libraries". It is useful to read "installing libcrypt-devel"

            – Rob Hall
            Jun 24 '14 at 14:33






            2




            2





            @RobHall Thanks for mentioning the library. I must have written it that way because I just went out and installed whatever had "crypt" in the name, and didn't know specifically which one helped.

            – sundar
            Jun 25 '14 at 15:37





            @RobHall Thanks for mentioning the library. I must have written it that way because I just went out and installed whatever had "crypt" in the name, and didn't know specifically which one helped.

            – sundar
            Jun 25 '14 at 15:37













            Cygwins gcc-g++ package had to be installed in my case (along with gcc-core and make)

            – Kjetil S.
            Nov 14 '17 at 11:27







            Cygwins gcc-g++ package had to be installed in my case (along with gcc-core and make)

            – Kjetil S.
            Nov 14 '17 at 11:27




















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • 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%2fsuperuser.com%2fquestions%2f647400%2fgcc-not-finding-header-file-though-its-path-has-been-included-with-i%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

            Aardman Animations

            Are they similar matrix

            “minimization” problem in Euclidean space related to orthonormal basis