GCC -std=gnu99 error












2















I'm trying to compile a C code with this command gcc -Wall -m32 -std=gnu99 -o <filename> <filename>



Instead of getting an output file, I get this.



/usr/bin/ld: cannot find Scrt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/bin/ld: cannot find libgcc_s.so.1
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status


Compiling with -std=c11 works perfectly fine, but not with -std=gnu99.










share|improve this question


















  • 1





    Have you installed gcc-multilib?

    – fkraiem
    Nov 12 '17 at 5:16


















2















I'm trying to compile a C code with this command gcc -Wall -m32 -std=gnu99 -o <filename> <filename>



Instead of getting an output file, I get this.



/usr/bin/ld: cannot find Scrt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/bin/ld: cannot find libgcc_s.so.1
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status


Compiling with -std=c11 works perfectly fine, but not with -std=gnu99.










share|improve this question


















  • 1





    Have you installed gcc-multilib?

    – fkraiem
    Nov 12 '17 at 5:16
















2












2








2








I'm trying to compile a C code with this command gcc -Wall -m32 -std=gnu99 -o <filename> <filename>



Instead of getting an output file, I get this.



/usr/bin/ld: cannot find Scrt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/bin/ld: cannot find libgcc_s.so.1
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status


Compiling with -std=c11 works perfectly fine, but not with -std=gnu99.










share|improve this question














I'm trying to compile a C code with this command gcc -Wall -m32 -std=gnu99 -o <filename> <filename>



Instead of getting an output file, I get this.



/usr/bin/ld: cannot find Scrt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/bin/ld: cannot find libgcc_s.so.1
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status


Compiling with -std=c11 works perfectly fine, but not with -std=gnu99.







gcc c






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 12 '17 at 4:06









SchmerzmittelSchmerzmittel

163




163








  • 1





    Have you installed gcc-multilib?

    – fkraiem
    Nov 12 '17 at 5:16
















  • 1





    Have you installed gcc-multilib?

    – fkraiem
    Nov 12 '17 at 5:16










1




1





Have you installed gcc-multilib?

– fkraiem
Nov 12 '17 at 5:16







Have you installed gcc-multilib?

– fkraiem
Nov 12 '17 at 5:16












2 Answers
2






active

oldest

votes


















0














Bascially this means that you don't have 32 bits support on your system, just 64 bits.



With main.c



/*  extern void start();                                                     */

int main()
{
/* start(); */
}


and



gcc -m32 main.c -o main


I got on an ubuntu 18.04 with just gcc installed:



> ~/PROJECT2/ciforthcvs$ gcc -m32 main.c -o main /usr/bin/ld: cannot
> find Scrt1.o: No such file or directory /usr/bin/ld: cannot find
> crti.o: No such file or directory /usr/bin/ld: skipping incompatible
> /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
> /usr/bin/ld: cannot find -lgcc /usr/bin/ld: skipping incompatible
> /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
> /usr/bin/ld: cannot find -lgcc collect2: error: ld returned 1 exit
> status


after



su
# apt install multi-lib


Everything went nice, and I could run my do nothing program.






share|improve this answer

































    -1
















    try:



    find / -iname='*Scrit1.o*' 2>/dev/null
    find / -iname='*criti.o*' 2>/dev/null


    modify your gcc command to read



    gcc -Wall -m32 -std=gnu99 -o <filename> <filename> /some-path/Scrit1.o /some-other-path/criti.o





    share|improve this answer


























    • really mister Ward, if the base files for the loader were present, do you think ld would need help in findng them?

      – Albert van der Horst
      yesterday











    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    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%2faskubuntu.com%2fquestions%2f975609%2fgcc-std-gnu99-error%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









    0














    Bascially this means that you don't have 32 bits support on your system, just 64 bits.



    With main.c



    /*  extern void start();                                                     */

    int main()
    {
    /* start(); */
    }


    and



    gcc -m32 main.c -o main


    I got on an ubuntu 18.04 with just gcc installed:



    > ~/PROJECT2/ciforthcvs$ gcc -m32 main.c -o main /usr/bin/ld: cannot
    > find Scrt1.o: No such file or directory /usr/bin/ld: cannot find
    > crti.o: No such file or directory /usr/bin/ld: skipping incompatible
    > /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
    > /usr/bin/ld: cannot find -lgcc /usr/bin/ld: skipping incompatible
    > /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
    > /usr/bin/ld: cannot find -lgcc collect2: error: ld returned 1 exit
    > status


    after



    su
    # apt install multi-lib


    Everything went nice, and I could run my do nothing program.






    share|improve this answer






























      0














      Bascially this means that you don't have 32 bits support on your system, just 64 bits.



      With main.c



      /*  extern void start();                                                     */

      int main()
      {
      /* start(); */
      }


      and



      gcc -m32 main.c -o main


      I got on an ubuntu 18.04 with just gcc installed:



      > ~/PROJECT2/ciforthcvs$ gcc -m32 main.c -o main /usr/bin/ld: cannot
      > find Scrt1.o: No such file or directory /usr/bin/ld: cannot find
      > crti.o: No such file or directory /usr/bin/ld: skipping incompatible
      > /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
      > /usr/bin/ld: cannot find -lgcc /usr/bin/ld: skipping incompatible
      > /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
      > /usr/bin/ld: cannot find -lgcc collect2: error: ld returned 1 exit
      > status


      after



      su
      # apt install multi-lib


      Everything went nice, and I could run my do nothing program.






      share|improve this answer




























        0












        0








        0







        Bascially this means that you don't have 32 bits support on your system, just 64 bits.



        With main.c



        /*  extern void start();                                                     */

        int main()
        {
        /* start(); */
        }


        and



        gcc -m32 main.c -o main


        I got on an ubuntu 18.04 with just gcc installed:



        > ~/PROJECT2/ciforthcvs$ gcc -m32 main.c -o main /usr/bin/ld: cannot
        > find Scrt1.o: No such file or directory /usr/bin/ld: cannot find
        > crti.o: No such file or directory /usr/bin/ld: skipping incompatible
        > /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
        > /usr/bin/ld: cannot find -lgcc /usr/bin/ld: skipping incompatible
        > /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
        > /usr/bin/ld: cannot find -lgcc collect2: error: ld returned 1 exit
        > status


        after



        su
        # apt install multi-lib


        Everything went nice, and I could run my do nothing program.






        share|improve this answer















        Bascially this means that you don't have 32 bits support on your system, just 64 bits.



        With main.c



        /*  extern void start();                                                     */

        int main()
        {
        /* start(); */
        }


        and



        gcc -m32 main.c -o main


        I got on an ubuntu 18.04 with just gcc installed:



        > ~/PROJECT2/ciforthcvs$ gcc -m32 main.c -o main /usr/bin/ld: cannot
        > find Scrt1.o: No such file or directory /usr/bin/ld: cannot find
        > crti.o: No such file or directory /usr/bin/ld: skipping incompatible
        > /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
        > /usr/bin/ld: cannot find -lgcc /usr/bin/ld: skipping incompatible
        > /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a when searching for -lgcc
        > /usr/bin/ld: cannot find -lgcc collect2: error: ld returned 1 exit
        > status


        after



        su
        # apt install multi-lib


        Everything went nice, and I could run my do nothing program.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited yesterday









        Sergiy Kolodyazhnyy

        71.9k9148314




        71.9k9148314










        answered yesterday









        Albert van der HorstAlbert van der Horst

        1515




        1515

























            -1
















            try:



            find / -iname='*Scrit1.o*' 2>/dev/null
            find / -iname='*criti.o*' 2>/dev/null


            modify your gcc command to read



            gcc -Wall -m32 -std=gnu99 -o <filename> <filename> /some-path/Scrit1.o /some-other-path/criti.o





            share|improve this answer


























            • really mister Ward, if the base files for the loader were present, do you think ld would need help in findng them?

              – Albert van der Horst
              yesterday
















            -1
















            try:



            find / -iname='*Scrit1.o*' 2>/dev/null
            find / -iname='*criti.o*' 2>/dev/null


            modify your gcc command to read



            gcc -Wall -m32 -std=gnu99 -o <filename> <filename> /some-path/Scrit1.o /some-other-path/criti.o





            share|improve this answer


























            • really mister Ward, if the base files for the loader were present, do you think ld would need help in findng them?

              – Albert van der Horst
              yesterday














            -1












            -1








            -1









            try:



            find / -iname='*Scrit1.o*' 2>/dev/null
            find / -iname='*criti.o*' 2>/dev/null


            modify your gcc command to read



            gcc -Wall -m32 -std=gnu99 -o <filename> <filename> /some-path/Scrit1.o /some-other-path/criti.o





            share|improve this answer

















            try:



            find / -iname='*Scrit1.o*' 2>/dev/null
            find / -iname='*criti.o*' 2>/dev/null


            modify your gcc command to read



            gcc -Wall -m32 -std=gnu99 -o <filename> <filename> /some-path/Scrit1.o /some-other-path/criti.o






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 12 '17 at 4:40









            Thomas Ward

            44.3k23123176




            44.3k23123176










            answered Nov 12 '17 at 4:35









            rhubarbdogrhubarbdog

            20717




            20717













            • really mister Ward, if the base files for the loader were present, do you think ld would need help in findng them?

              – Albert van der Horst
              yesterday



















            • really mister Ward, if the base files for the loader were present, do you think ld would need help in findng them?

              – Albert van der Horst
              yesterday

















            really mister Ward, if the base files for the loader were present, do you think ld would need help in findng them?

            – Albert van der Horst
            yesterday





            really mister Ward, if the base files for the loader were present, do you think ld would need help in findng them?

            – Albert van der Horst
            yesterday


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • 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%2faskubuntu.com%2fquestions%2f975609%2fgcc-std-gnu99-error%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

            How did Captain America manage to do this?

            迪纳利

            南乌拉尔铁路局