Home > Back-end >  Hello world program in c, "cannot find -lgcc" error
Hello world program in c, "cannot find -lgcc" error

Time:01-09

Complete novice here. I'm learning c programming and I started out with the canonical hello world program, but I got 5 errors when I tried to build and run the program.

this is the code I wrote:

#include <stdio.h>
int main(){
    printf("hello world");

    }

And these are the errors I got:

CodePudding user response:

I don't think you want to link with the gcc and gcc_eh libraries. Per manual section 4.2.3 under the "Compiler Toolbar" there is a "Linker Settings" that would allow you to remove those two libraries.

CodePudding user response:

I think your code block has not any builtin compiler or the compiler isn't setup properly. I can suggest you some ways:

  • Goto Settings > Compiler > Toolchain executables and check the compiler directory. You can try auto detect option also.
  • If previous one doesn't work, then install compiler(I prefer MINGW). You can do it by following this blog. Then select the correct by following the previous way.
  • Related