• Advertisement
Sign in to follow this  

unresolved external symbol _WinMain@16

This topic is 1732 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

#include <windows.h>
int WINAPI winMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd)
{
    MessageBox(NULL,L"Some text",L"Info",MB_OKCANCEL | MB_ICONINFORMATION);

    return 0;
}

Error    1    error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup    C:\Bob\Projects\Part1\Part1\MSVCRTD.lib(crtexew.obj)    Part1

Share this post


Link to post
Share on other sites
Advertisement

That .cpp/.c file where you entered that code, make sure you add it to the project. Right Click on the Solution Explorer and choose "Add". Once the file shows up there it should be compiled and linked.

Share this post


Link to post
Share on other sites

Why was the original post deleted? In the GameDev.net community, we generally leave them in place for future programmers who have the same problem.

 

Zaoshi Kaba's solution is the correct answer; it's an easy mistake to make and one that future programmers will likely make and need to know the solution of. 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement