0

when I compile my project, I get the following error.

error:Multiple definition of main() what is the problem?

Here is the code:

int main(int argc, char *argv[])
{
  QCoreApplication a(argc, argv);

myserver server;
server.startserver();

return a.exec();
}
The Apache
  • 1,076
  • 11
  • 28
Hanita
  • 179
  • 13

1 Answers1

5

That means in your program you have at least two functions named main. Search for main in your source files and eliminate one or more (by renaming/refactoring for example).

You can have only one function called main in a C/C++ program.

Ely
  • 10,860
  • 4
  • 43
  • 64