无法解析外部符号??
#include<windows.h>LRESULT CALLBACK WndPorc(HWND, UINT, WPARAM, LPARAM);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
static TCHAR szName[] = TEXT("HELLOWIN");
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndPorc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szName;
if (RegisterClass(&wndclass))
{
MessageBox(NULL, TEXT("注册失败"), TEXT("警告"), MB_ICONERROR);
return(0);
}
hwnd = CreeatWindow(szName,
TEXT("the hello paogram"),
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);
showWindow(hwnd, iCmdShow);
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)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
switch (message)
{
case WM_CREATE:PlaySound(TEXT("hellowin.wav"), NULL, SND_FILENAME | SND_ASYNC);
return(0);
case WM_PAINT: hdc = BeginPaint(hwnd, &ps);
GetClientRect(hwnd, &rect);
DrawText(hdc, TEXT("hello,windows!!!"), -1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
EndPaint(hwnd, &ps);
return(0);
case WM_DESTROY:PostQuitMessage(0);
return(0);
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
//代码确实没错啊也没有红色波浪线提示错误 是不是有什么文件没有添加啊
/*错误 5 error LNK1120: 4 个无法解析的外部命令 D:\l\windows程序\第2章\练习1\Debug\练习1.exe 1 1 练习1
错误 2 error LNK2019: 无法解析的外部符号 _CreeatWindow,该符号在函数 _WinMain@16 中被引用 D:\l\windows程序\第2章\练习1\练习1\练习1.obj 练习1
错误 3 error LNK2019: 无法解析的外部符号 _showWindow,该符号在函数 _WinMain@16 中被引用 D:\l\windows程序\第2章\练习1\练习1\练习1.obj 练习1
错误 4 error LNK2019: 无法解析的外部符号 _Updatewindow,该符号在函数 _WinMain@16 中被引用 D:\l\windows程序\第2章\练习1\练习1\练习1.obj 练习1
错误 1 error LNK2019: 无法解析的外部符号 _WndPorc@16,该符号在函数 _WinMain@16 中被引用 D:\l\windows程序\第2章\练习1\练习1\练习1.obj 练习1*/
刚刚仔细检查了 发现是自己打错了 失败啊。。。。。。。{:10_250:}{:10_250:}{:10_250:}
页:
[1]