Microsoft KB Archive/125750

= You receive an "unresolved external symbol _WinMain@16" error message when you try to build an MFC application with Unicode support in Visual C++ =

Article ID: 125750

Article Last Modified on 5/31/2005

-

APPLIES TO

 The C Run-Time (CRT), when used with:  Microsoft Visual C++ 2.0 Professional Edition

 Microsoft Visual C++ 2.1

 Microsoft Visual C++ 4.0 Standard Edition

 Microsoft Visual C++ 5.0 Enterprise Edition</li></ul>

 Microsoft Visual C++ 6.0 Enterprise Edition</li></ul>

 Microsoft Visual C++ 5.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Standard Edition</li></ul>

 Microsoft Visual C++ .NET 2002 Standard Edition</li></ul>

 Microsoft Visual C++ .NET 2003 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q125750

<div class="notice_section">

NOTE: Microsoft Visual C++ NET (2002) supported both the managed code model that is provided by the .NET Framework and the unmanaged native Windows code model. The information in this article applies to unmanaged Visual C++ code only.

<div class="symptoms_section">

SYMPTOMS
The linker generates the following error, when you build an MFC application with UNICODE support using the Microsoft products listed at the beginning of this article:

msvcrt.lib(crtexew.obj) : error LNK2001: unresolved external

symbol "_WinMain@16"

Visual C++ .NET:

error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup

fatal error LNK1120: 1 unresolved externals

<div class="cause_section">

CAUSE
MFC UNICODE applications use wWinMainCRTStartup as the entry point.

<div class="resolution_section">

RESOLUTION
In the Output category of the Link tab in the Project Settings dialog box, set the Entry Point Symbol to wWinMainCRTStartup.

For Visual C++ .NET: In the Advanced category of the Linker folder in the Project Properties dialog box, set the Entry Point to wWinMainCRTStartup.

<div class="status_section">

STATUS
This behavior is by design.

<div class="references_section">