Vs error unresolved external symbol_ Main, the symbol in the function “int”__ cdecl invoke_ main

Cause analysis

There are many reasons for this problem. The first and most common one is that there are multiple CPP files in your project, which contain multiple main functions
the second is that your code is copied from QQ or other ways (such as Notepad). In this case, the newline character may change. According to the explanation of the online boss, the newline character has many codes. If the format is wrong, there will be problems. At this time, you will be prompted to convert the source file to DOS or UNIX format, If there is a warning, it means that you are in this situation. You need to find the advanced save option in the file menu of vs (the advanced version needs to be called out in the settings, but not Baidu search), and then select window (CR LF), which means that the new line character supported by the window system indicates that the problem is solved ~
the third is that your project is created incorrectly, If your compiler’s preprocessor is not right, you can copy the code directly to the new correct project, or open the project settings and modify your preprocessor. You can search for it.

Read More: