0

I am trying to fix the error in the following C program, that I get in the terminal in VSCode ?

#include <stdio.h>

main()
{
    printf("just one small step for coders.one giant leap for\n");
    printf("programmers\n");
    return 0;
}

Below is the error that I get while compiling in the VSCode terminal:

Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Emma
  • 27,428
  • 11
  • 44
  • 69
jojo9
  • 3
  • 4

2 Answers2

0

Try to put return data type of main function

int main(){

Maybe this is noy solution but this is the only reason that comes to mind.

Bane2000
  • 187
  • 1
  • 9
-1

You are missing the inclues, this code run for me, and if you are doing everything okay it should run for you:

#include<stdio.h>
#include<stdlib.h>
int main()
{
    printf("just one small step for coders.one giant leap for\n");
    printf("programmers\n");
    return 0;
}
Sidali Smaili
  • 119
  • 2
  • 7