Msvcrtd. Lib (crtexew. OBJ): Error lnk2019: external symbol that cannot be parsed _ winmain @ 16, which is in the function ___ tmainc

Source: Internet
Author: User

I. Problem Description
Msvcrtd. Lib (crtexew. OBJ): Error lnk2019: external symbols that cannot be parsed_ Winmain @ 16, which is referenced in the ___ tmaincrtstartup Function

Debug \ jk.exe: Fatal error lnk1120: 1 external command that cannot be parsed

Error lnk2001: unresolved external symbol_ Winmain @ 16
Debug/main.exe: Fatal error lnk 1120:1 unresolved externals
Error executing link.exe;

Ii. causes and solutions
The real cause of this problem is that the appropriate program entry function cannot be found during the C language runtime,

In general, if it is a Windows program, winmain is the entry function. In vs2010, create a project as a "Win32 project"

If it is a DOS console program, the main function is the portal function. In vs2010, create a project as "Win32 console application"

If the entry function is improperly specified, it is obvious that the function cannot be found during the C language runtime, and an error will be reported.

Modify settings to meet your needs

If you need a Windows program:


1. Select project> properties from the menu to bring up the property pages window.

2. select Configuration properties-> C/C ++-> Preprocessor from the left-side Navigation Pane, delete _ console from the Preprocessor definitions item on the right-side bar, and add _ windows.

3. Select Configuration Properties> linker> system from the left-side Navigation Pane, and change the item corresponding to subsystem in the right-side Navigation Pane to Windows (/subsystem: Windows)


If you need a console program:


1. Select project> properties from the menu to bring up the property pages window.

2. select Configuration Properties> C/C ++> Preprocessor from the left-side Navigation Pane, delete _ WINDOWS from the Preprocessor definitions option on the right-side bar, and add _ console.

3. Select Configuration Properties> linker> system from the left-side Navigation Pane, and change the item corresponding to subsystem in the right-side Navigation Pane to console (/subsystem: Console)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.