One project must have only one main function.
In addition to the cpp file containing the code of the question, another cpp file is included in the project, and there will be a main function in it. Maybe it's a code that I wrote for another example or homework.
If you only leave a cpp file containing the code of the question, remove the existing file from the project and build it, the error will be resolved.
© 2022 pinfo. All rights reserved.