0

Hi I get the common Undefined References error in CodeBlocks I am pretty sure The code is right.

case WM_PAINT:
		{
            BITMAP bm;
			PAINTSTRUCT ps;

			HDC hdc = BeginPaint(hwnd, &ps);

			HDC hdcMem = CreateCompatibleDC(hdc);
			HBITMAP hbmOld = (HBITMAP)SelectObject(hdcMem, g_hbmAnime);

			GetObject(g_hbmAnime, sizeof(bm), &bm);

			BitBlt(hdc, 150, 100, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY);

			SelectObject(hdcMem, hbmOld);
			DeleteDC(hdcMem);

			EndPaint(hwnd, &ps);
		}

compiler error:

obj\Debug\aimain.o:aimain.cpp:(.text+0x214)||undefined reference to `_CreateCompatibleDC@4'|
obj\Debug\aimain.o:aimain.cpp:(.text+0x22e)||undefined reference to `_SelectObject@8'|
obj\Debug\aimain.o:aimain.cpp:(.text+0x250)||undefined reference to `_GetObjectA@12'|
obj\Debug\aimain.o:aimain.cpp:(.text+0x29b)||undefined reference to `_BitBlt@36'|
obj\Debug\aimain.o:aimain.cpp:(.text+0x2b0)||undefined reference to `_SelectObject@8'|
obj\Debug\aimain.o:aimain.cpp:(.text+0x2be)||undefined reference to `_DeleteDC@4'|
||=== Build finished: 6 errors, 0 warnings ===|

anyone knows how to fix this ?

2
Contributors
4
Replies
8
Views
8 Years
Discussion Span
Last Post by h3llpunk
0

thx will marking this as solved and hope this will help me for future references

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.