Compiling: C:\Documents and Settings\Administrator\naoxi.cpp
Linking console executable: C:\Documents and Settings\Administrator\naoxi.exe
C:\Documents and Settings\Administrator\naoxi.o:naoxi.cpp:(.text+0x8c)锛氬鈥楪etStockObject@4鈥欐湭瀹氫箟鐨勫紩鐢uments and Settings\Administrator\naoxi.o:naoxi.cpp:(.text+0x229)锛氬鈥楽etTextColor@8鈥欐湭瀹氫箟鐨勫紩鐢uments and Settings\Administrator\naoxi.o:naoxi.cpp:(.text+0x23e)锛氬鈥楪etTextMetricsA@8鈥欐湭瀹氫箟鐨勫紩鐢uments and Settings\Administrator\naoxi.o:naoxi.cpp:(.text+0x2c6)锛氬鈥楥reateFontA@56鈥欐湭瀹氫箟鐨勫紩鐢uments and Settings\Administrator\naoxi.o:naoxi.cpp:(.text+0x311)锛氬鈥楾extOutA@20鈥欐湭瀹氫箟鐨勫紩鐢t2:ld returned 1 exit status
Process terminated with status 1 (0 minutes, 3 seconds)
0 errors, 0 warnings
#include<windows.h>
#include<iostream>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInst,LPSTR lpszCmdLine,int nCmdShow)
{
HWND hwnd;
MSG Msg;
WNDCLASS wndclass;
char lpszClassName[]="Hello";
char lpszTitle[]="I love BLEACH";
wndclass.style=0;
wndclass.lpfnWndProc=WndProc;
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=lpszClassName;
if(!RegisterClass(& wndclass))
{
MessageBeep(0);
return FALSE;
}
hwnd=CreateWindow(
lpszClassName,
lpszTitle,
WS_OVERLAPPEDWINDOW ,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
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)
{
HDC hdc;
HFONT hF_black;
PAINTSTRUCT ps;
TEXTMETRIC tm;
char lpsz_1[]="I love BLEACH";
int X=0,Y=0;
int i;
switch(message)
{case WM_PAINT:
hdc=BeginPaint(hwnd,&ps);
SetTextColor(hdc,RGB(255,0,0));
GetTextMetrics(hdc,&tm);
Y=Y+tm.tmHeight+tm.tmExternalLeading;
hF_black=CreateFont(
0,
0,
0,
0,
FW_HEAVY,
0,
0,
0,
GB2312_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH|FF_DONTCARE, "gerry");
for(i=0;i<200;i++)
{Sleep(5);
TextOut(hdc,X+i,Y,lpsz_1,13);
InvalidateRect(hwnd,NULL,1);
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd,message,wParam,lParam);
}
return 0;
}
mingw32-g++.exe -fexec-charset=GBK -c "C:\Documents and Settings\Administrator\naoxi.cpp" -o "C:\Documents and Settings\Administrator\naoxi.o"
mingw32-g++.exe -o "C:\Documents and Settings\Administrator\naoxi.exe" "C:\Documents and Settings\Administrator\naoxi.o"
C:\Documents and Settings\Administrator\naoxi.o:naoxi.cpp:(.text+0x1a1): undefined reference to `_GetStockObject@4'
C:\Documents and Settings\Administrator\naoxi.o:naoxi.cpp:(.text+0x36d): undefined reference to `_SetTextColor@8'
C:\Documents and Settings\Administrator\naoxi.o:naoxi.cpp:(.text+0x385): undefined reference to `_GetTextMetricsA@8'
C:\Documents and Settings\Administrator\naoxi.o:naoxi.cpp:(.text+0x414): undefined reference to `_CreateFontA@56'
C:\Documents and Settings\Administrator\naoxi.o:naoxi.cpp:(.text+0x47a): undefined reference to `_TextOutA@20'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 6 seconds)
5 errors, 0 warnings
mingw32-g++.exe -march=i686 -fexec-charset=GBK -mwindows -c "C:\Documents and Settings\Administrator\naoxi.cpp" -o "C:\Documents and Settings\Administrator\naoxi.o"
mingw32-g++.exe -o "C:\Documents and Settings\Administrator\naoxi.exe" "C:\Documents and Settings\Administrator\naoxi.o"
C:\Documents and Settings\Administrator\naoxi.o:naoxi.cpp:(.text+0x8f): undefined reference to `GetStockObject@4'
C:\Documents and Settings\Administrator\naoxi.o:naoxi.cpp:(.text+0x226): undefined reference to `SetTextColor@8'
C:\Documents and Settings\Administrator\naoxi.o:naoxi.cpp:(.text+0x23b): undefined reference to `GetTextMetricsA@8'