windows编程为什么不能在vc++6.0上运行?
#include<windows.h>LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow )
{
HWND hwnd;
MSG msg;
WNDCLASS wc;
char lpszClassName[]="my winows!";
wc.style=0;
wc.lpszMenuName=NULL;
wc.lpszClassName=lpszClassName;
wc.lpfnWndProc=WndProc;
wc.hInstance=hInstance;
wc.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wc.hCursor=LoadCursor(NULL,IDC_ARROW);
wc.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wc.cbWndExtra=0;
wc.cbClsExtra=0;
RegisterClass(&wc);
hwnd=CreateWindow(lpszClassName,"windows",WS_OVERLAPPEDWINDOW,120,50,800,600,NULL,NULL,hInstance,NULL);
ShowWindow(hwnd,nCmdShow);
UpdateWindow(hwnd);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
{
switch(message)
{
case WM_LBUTTONDOWN:
MessageBeep(0);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd,message,wParam,lParam);
}
return 0;
}
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/a.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
为什么一个最简单的windows编程在vc++6.0上运行不了?求大神指教.....