"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > 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?

Published on 2024-11-09
Browse:656

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.

Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3