各位好:
 在编译时出现以下错误提示:
Linking...
winmain.obj : error LNK2001: unresolved external symbol "long __stdcall WinZhongProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WinZhongProc@@YGJPAUHWND__@@IIJ@Z)
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/winmain.exe : fatal error LNK1120: 2 unresolved externals
执行 link.exe 时出错.winmain.exe - 1 error(s), 0 warning(s)
源程序
#include<windows.h>
#include<stdio.h>LRESULT CALLBACK WinZhongProc(
 HWND hwnd,
 UINT uMsg,
 WPARAM wparam,
 LPARAM lparam
 );int WINAPI winmain(
   HINSTANCE hInstance,
   HINSTANCE hPrevInstance,
   LPSTR lpCmdLine,
   int nCmdShow
   )
{
//设计一个窗口类
WNDCLASS wndcls;
wndcls.cbClsExtra=0;
wndcls.cbWndExtra=0;
wndcls.hbrBackground=(HBRUSH)GetStockObject(BLACK_BRUSH);
wndcls.hCursor=LoadCursor(NULL,IDC_CROSS);
wndcls.hInstance=hInstance;  //应用程序实例句柄由winmain函数传递过来
wndcls.lpfnWndProc=WinZhongProc;
wndcls.lpszClassName="winmain";
wndcls.lpszMenuName=NULL;
wndcls.style=CS_HREDRAW | CS_VREDRAW;
RegisterClass(&wndcls); HWND hwnd;
hwnd=CreateWindow("winmain","what fuck you doing?",WS_OVERLAPPEDWINDOW,0,0,600,400,NULL,NULL,hInstance,NULL); //显示及刷新窗口
ShowWindow(hwnd,SW_SHOWNORMAL);
UpdateWindow(hwnd); //定义消息体结构,开始消息循环
MSG msg;
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}//编写窗口过程函数
LRESULT CALLBACK WinZhongPro(
         HWND hwnd,
 UINT uMsg,
 WPARAM wparam,
 LPARAM lparam
 )
{
switch(uMsg)
{
case WM_CHAR:
char szChar[20];
sprintf("szChar","f ck,all i need is u %d",wparam);
MessageBox(hwnd,szChar,"char",0);
break;
case WM_LBUTTONDOWN:
MessageBox(hwnd,"clicked","message",0);
HDC hdc;
hdc=GetDC(hwnd);  //不能在相应WM_PAINT消息时调用
TextOut(hdc,0,50,"程序员之家",strlen("程序员之家"));
ReleaseDC(hwnd,hdc);
break;
case WM_PAINT:
HDC hDC;
PAINTSTRUCT ps;
hDC=BeginPaint(hwnd,&ps);
TextOut(hDC,0,0,"f ck,all i need i u",strlen("f ck,all i need i u"));
EndPaint(hwnd,&ps);
break;
case WM_CLOSE:
if(IDYES==MessageBox(hwnd,"you sure you need me now?","Message",MB_YESNO))
{
DestroyWindow(hwnd);
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd,uMsg,wparam,lparam);
}
return 0;
}
请求能者帮忙解答,谢谢!