Home >Backend Development >C++ >Why Am I Getting 'error LNK2019: unresolved external symbol _WinMain@16' and How Do I Fix It?

Why Am I Getting 'error LNK2019: unresolved external symbol _WinMain@16' and How Do I Fix It?

Patricia Arquette
Patricia ArquetteOriginal
2024-12-05 09:20:10464browse

Why Am I Getting

Resolving "error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup"

When attempting to compile code containing a simple implementation of a stack template, several users encountered two errors related to unresolved external symbols. After careful analysis, the root cause was identified as a linker problem within the program's configuration.

To resolve this issue, it is crucial to modify the project's linker settings. Navigate to the "Properties" tab, followed by the "Linker" section. Under the "System" category, locate the "SubSystem" option and change it from the default setting of "Windows (/SUBSYSTEM:WINDOWS)" to "Console (/SUBSYSTEM:CONSOLE)".

This modification ensures that the program will be compiled as a console application, which is compatible with the included code. Implementing this configuration change successfully resolved the "error LNK2019" and enabled the program to compile and run as expected.

The above is the detailed content of Why Am I Getting 'error LNK2019: unresolved external symbol _WinMain@16' and How Do I 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