Sign in to follow this  
BUCHANKO

unresolved external symbol _WinMain@16

Recommended Posts

BUCHANKO    119
#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
Endurion    5407

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this