First, you could find your answers already posted on StackOverflow. You should read your error messages, and then try to understand what they mean through your own searches.
undefined reference to 'main' error is explained here:
Undefined reference to main - collect2: ld returned 1 exit status
Essentially, in C language, void is not a valid return for main() function (i.e. void main(void)). With gcc compiler, which I think, is similar to clang, when main() has no specification, your return defaults to int. So, you have main() function with no return value, when a return is needed. Read this other StackOverflow Q & A for more information on valid signatures for C's main() function:
What are the valid signatures for C's main() function?
Since, I'm not familiar with clang compiler, there may be something else happening besides these errors.