chomi525 Temat założony przez niniejszego użytkownika |
undefined reference to "TextOutA@20" » 2014-11-14 22:57:47 Witam mam problem gdy próbuje skompilować ten program pojawia się błąd undefined reference to "TextOutA@20" źródło:
#define WIN32_LEAN_AND_MEAN
#include <glut.h> #include <stdlib.h> #include <windows.h>
int widthWindow = 600; int heightWindow = 600;
int positionWindow_x = 100; int positionWindow_y = 100;
LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParm,LPARAM lParam); //deklaracja procedury okienkowej
//*******************************************MAIN*************************************************************** int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) { HWND hwnd; MSG msg; bool done; WNDCLASSEX windowsClass; //deklaracja klasy okna
//atrybuty klasy okna windowsClass.cbSize = sizeof(WNDCLASSEX); windowsClass.style = CS_HREDRAW | CS_VREDRAW; windowsClass.lpfnWndProc = WndProc; windowsClass.cbClsExtra = 0; windowsClass.cbWndExtra = 0; windowsClass.hInstance = hInstance; windowsClass.hIcon = LoadIcon(NULL, IDI_WINLOGO); windowsClass.hCursor = LoadCursor(NULL, IDC_ARROW); windowsClass.hbrBackground = ( HBRUSH )( COLOR_WINDOW + 1 ); windowsClass.lpszMenuName = NULL; windowsClass.lpszClassName = "WindowClass_a"; windowsClass.hIconSm = LoadIcon(NULL, IDI_WINLOGO); //atrybuty klasy okna
if(!RegisterClassEx(&windowsClass)) { MessageBox(NULL,"error code : 1","error", MB_OK | MB_ICONEXCLAMATION); return 1; }
hwnd = CreateWindowEx(NULL,"WindowClass_a","Ronold",WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_SYSMENU, //tworzenie okna positionWindow_x, positionWindow_y, widthWindow, heightWindow,NULL,NULL,hInstance,NULL);
if(!hwnd) { MessageBox(NULL,"error code : 2","error",MB_OK | MB_ICONEXCLAMATION); return 1; }
done = false;
while(!done) { PeekMessage(&msg,hwnd,NULL,NULL,PM_REMOVE);
if(msg.message == WM_QUIT) { done = true; } else { TranslateMessage(&msg); DispatchMessage(&msg); } }
return msg.wParam; } //*******************************************MAIN***************************************************************
LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParm,LPARAM lParam) //procedura okienkowa { PAINTSTRUCT paintStruct; HDC hDC; char stringa[] = "witamy !";
switch(message) { case WM_CREATE: //tworzenie okna { return 0; break; } case WM_CLOSE: //zamykanie okna { return 0; break; } case WM_PAINT: //odrysowywanie zawartości okna { hDC = BeginPaint(hwnd, &paintStruct); TextOut(hDC,150,150,stringa,sizeof(stringa)-1);
EndPaint(hwnd, &paintStruct); return 0; break;
} default: break; }
return (DefWindowProc(hwnd,message,wParm,lParam)); }
|