Multiple definitions of “Main”

Multiple definitions of “main” suggests that you have another definition of main. Perhaps in another .c or .cpp file in your project. You can only have one function with the same name and signature (parameter types). Also, main is very special so you can only have one main function that can be used as the entry point (has either no parameters, one int, or an int and a char**) in your project.

P.S. Technically this is a linker error. It’s a subtle difference, but basically it’s complaining that the linker can’t determine which function should be the entry point, because there’s more than one definition with the same name.

Leave a Comment