You are currently offline, waiting for your internet to reconnect

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

This article was previously published under Q125750
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.
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
CAUSE
MFC UNICODE applications use wWinMainCRTStartup as the entry point.
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.
STATUS
This behavior is by design.
REFERENCES
The above information is documented in Books Online under this structure:
 - C/C++    - Programming Techniques       - Chapter 12 Developing for International Markets          - Support for Unicode             - Unicode Programming: Summary				
This reference also lists the additional steps that you need to consider to take advantage of the MFC and C run-time support for Unicode.
3.0 Unicode wWinMainCRTStartup
Properties

Article ID: 125750 - Last Review: 05/31/2005 23:30:21 - Revision: 4.1

The C Run-Time (CRT)

  • kbtshoot kberrmsg kbprb KB125750
Feedback
microsoft.com/c.gif?DI=4050&did=1&t=">