LIBCD.lib (wincrt0.obj): error LNK2001: unresolved external symbol _WinMain @ 16

    As shown in the title, when using vc ++ 6.0 to create a project, because the selected type is not correct, it was originally the console program Win32 Console Application. As a result, the window program Win32 Application was selected. No error is reported during compilation, but an error is reported during link building, because the main function entry of the window program is WinMain (), and the main function entry of the console application is main (). The screenshot of the error message is as follows:

    

    The specific error text information is as follows: 

Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/memset.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

memset.exe - 2 error(s), 0 warning(s)

    Knowing the cause of the error, the solution is easy to handle. You need to change the application to console application. At this time, you can only modify / subsystem: windows to / subsystem: console under Project-> Settings-> Link-> Project Options ,As follows:

     

    After modification, build again and pass smoothly without error. 

Published 529 original articles · praised 287 · 1.47 million views

Guess you like

Origin blog.csdn.net/feinifi/article/details/104612800