Original Post
compiler errors:
*************************************************************
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/GAME.exe : fatal error LNK1120: 1 unresolved externals
*************************************************************
the program is :
***************************************************************
#include <windows.h>
int WINAPI WinMain(HINSTANCE hinst,HINSTANCE hprevinst,LPSTR lpcmdline,int ncmdshow);
LRESULT CALLBACK Windowproc(HWND hwnd,UINT msg,WPARAM wparam ,LPARAM lparam);
int WINAPI WinMain(HINSTANCE hinst,HINSTANCE hprevinst,LPSTR lpcmdline,int ncmdshow)
{
HWND hwnd;
MSG msg;
WNDCLASSEX wc={sizeof(WNDCLASSEX),CS_CLASSDC,Windowproc,0L,0L,hinst,NULL,NULL,NULL,NULL,"GAMECLASS",NULL};
RegisterClassEx(&wc);
hwnd=CreateWindow("GAMECLASS","GAME",WS_MAXIMIZE|WS_OVERLAPPED,0,0,400,400,NULL,NULL,hinst,NULL);
ShowWindow(hwnd,SW_SHOWNORMAL);
UpdateWindow(hwnd);
ZeroMemory(&msg,sizeof(MSG));
while(msg.message!=WM_QUIT){
if(PeekMessage(&msg,NULL,0,0,PM_REMOVE)){
TranslateMessage(&msg);
DispatchMessage(&msg);
}else{
}
}
UnregisterClass("GAMECLASS",hinst);
return 0;
}
LRESULT CALLBACK Windowproc(HWND hwnd,UINT msg ,WPARAM wparam , LPARAM lparam)
{
switch (msg){
case WM_DESTROY:
PostQuitMessage(0);
break;
}
return 0;
}
************************************************************
How can i solve it?
and then , can you suggestion some option to compiler setting(project option)?
tototam