Error LNK2019: unresolved external symbol _winmain@16, which is referenced in function ___tmaincrtstartup

Source: Internet
Author: User

MSVCRTD.lib (crtexew.obj): Error LNK2019: unresolved external symbol [email protected], this symbol is referenced in function ___tmaincrtstartup
Debug\jk.exe:fatal error Lnk1120:1 an unresolved external command

Error lnk2001:unresolved external symbol [email protected]
Debug/main.exe:fatal error LNK 1120:1 unresolved externals
Error executing link.exe;

Second, causes and solutions
The real reason for this problem is that the C language runtime cannot find the proper program entry function.

In general, if it is a Windows program, then WinMain is the entry function, and the new project in VS2010 is "Win32 Project"

If it is a DOS console program, then main is the entry function, and a new project in VS2010 is "Win32 Console Application"

If the entry function is not properly specified, it is clear that the C language runtime cannot find a mate function and it will report an error.

Modify settings to suit your needs

If you need a Windows program:


1. Select Project->properties in the menu, pop up the property Pages window

2. In the left column, select: Configuration properties->c/c++->preprocessor, and then delete _console in the corresponding entry in the preprocessor definitions in the right column, Add _windows.

3. In the left column, select: Configuration properties->linker->system, and then change the SUBSYSTEM corresponding item in the right column to WINDOWS (/subsystem:windows)


If you need a console program:


1. Select Project->properties in the menu, pop up the property Pages window

2. In the left column, select: Configuration properties->c/c++->preprocessor, and then delete _windows in the corresponding entry in the preprocessor definitions in the right column, Add _console.

3. In the left column, select: Configuration properties->linker->system, then change the SUBSYSTEM corresponding item in the right column to CONSOLE (/subsystem:console)

Transferred from: http://blog.csdn.net/lixuyuan/article/details/7576225

Error LNK2019: unresolved external symbol [email  Protected] , the symbol is referenced in the function ___tmaincrtstartup

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.