Sorry if this is a repeat question, but I couldn't find an answer that worked.
I'm writing a Hello World C program for the first time in a long time. I'm fairly certain the code is right, but it won't compile.
Running MAC OS 10.13.6 and I just downloaded XCode last week. The program compiles into an object file using
cc -c test.c -o test.o
without a problem. However, I can't create an executable using
cc test.o -o test
Here's the code:
#include <stdio.h>
int Main()
{
printf("Hello World");
return 0;
}
When I go to create the executable, I get
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
I'm guessing I need to add some compiler flags but can't figure out which ones.