Somewhere, in all the compiled binary objects being gathered together, you have more than one main. This may not be in your code. They may be in other code that has already been compiled. They may be in libraries.
You should look at the error messages. They will tell you where the repeated mains are.