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

case WM_PAINT:
            BITMAP bm;

			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);

			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 ?

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.