I tried looking everywhere to see if theres an answer but it seems that people have encountered the similar problem but none of the solutions that I read have worked.
Im using gcc as my compiler
I am familiar with c++ but never encountered a problem like this on c++, but, Im just trying to do a simple printf and scanf for user input and printing out the results.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int num1, num2;
printf("Enter two integers: \n");
scanf("%d%d",&num1,&num2);
printf("your two integers are: %d and %d \n", num1,num2 );
return 0;
}
the error that I get in the 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)
thank you in advanced!
gccmight be a symlink toclang, for compatibility.