Home  >  Article  >  Backend Development  >  Why Am I Getting \'Unresolved External Symbol _main\' Error and How to Fix It?

Why Am I Getting \'Unresolved External Symbol _main\' Error and How to Fix It?

DDD
DDDOriginal
2024-10-29 18:46:23626browse

Why Am I Getting

Unresolved External Symbol _main: Targeting the Correct Entry Point

When encountering the error "error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup," it indicates that the linker cannot find a required entry point for the program. Despite having defined a main() function, the linker may become confused.

To rectify this issue in Visual Studio 2010, navigate to:

Project -> Properties -> Configuration Properties -> Linker -> System

Under the System settings, identify the SubSystem property and set it to "Console."

This adjustment clarifies for the linker that the program is a console application and establishes the proper entry point, resolving the unresolved external symbol error.

The above is the detailed content of Why Am I Getting \'Unresolved External Symbol _main\' Error and How to Fix It?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn