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:
- Error LNK2019: unresolved external symbol_ Main the symbol is in the function___ Tmaincrtstartup
- [OpenGL · error] visual studio 2019 reports an error. It is an external symbol gladloadglloader that cannot be parsed. This symbol is referenced in the function main
- DirectX encountered “unresolved external symbol” when compiling on vs2015__ The solution and reason of “vsnwprintf”
- LNK2001: unresolved external symbol maincrtstartup
- error LNK2019: Unresolved external symbol-resolution record
- LINK : error LNK2001: unresolved external symbol _mainCRTStartup
- Solutions to the problem of “symbol lookup error xxxxx, undefined symbol”
- dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
- LNK2019 failed to parse external symbol error
- chattr: symbol lookup error: chattr: undefined symbol: fsetproject
- Error in ROS installation function package bionic / main AMD64
- Solution: vs2017 cannot open header files such as stdio. H main. H
- In function `_start’ undefined reference to `main’ error: ld returned 1 exit status
- vs2013 wdk8.1 ERROR: Symbol file could not be found. Defaulted to export symbols for ntkrnlmp.exe
- Error lnk1120: 2 unresolved external commands: vtkrenderingopengl_ Autoinit (construct, destroy), which is referenced in
- When Maven hits the jar package, an error is reported when executing install, and the symbol cannot be found in a line
- [Solved] KEIL MDK Warning: “no browse info for symbol in this context”
- A JavaScript error occurred in the main process
- @In slf4j log.info Compile error: cannot find symbol log
- DB2 create table error – 104 42601 illegal symbol encountered in SQL statement