title: Gdiplus Bitmap error
body: <p>I'm trying to convert an HBITMAP to a Gdiplus Bitmap. My code is getting a screenshot with some code I found from google and putting it in an HBITMAP. I want to get the rgb values (specifically argb) using Gdiplus.</p>
  
  <p>The code getting the screenshot works file, but the line that turns the HBITMAP into a Bitmap throws a ton of crazy linker errors. Here is my code:</p>
  
  <pre><code>HDC hScreenDC = CreateDC((LPCWSTR)"DISPLAY", NULL, NULL, NULL);     
  // and a device context to put it in
  HDC hMemoryDC = CreateCompatibleDC(hScreenDC);
  
  int x = GetDeviceCaps(hScreenDC, HORZRES);
  int y = GetDeviceCaps(hScreenDC, VERTRES);
  
  // maybe worth checking these are positive values
  HBITMAP hBitmap = CreateCompatibleBitmap(hScreenDC, x, y);
  
  // get a new bitmap
  HBITMAP hOldBitmap = (HBITMAP)SelectObject(hMemoryDC, hBitmap);
  
  BitBlt(hMemoryDC, 0, 0, 1920, 1080, hScreenDC, 0, 0, SRCCOPY);
  hBitmap = (HBITMAP)SelectObject(hMemoryDC, hOldBitmap);
  
  // clean up
  DeleteDC(hMemoryDC);
  DeleteDC(hScreenDC);
  
  Gdiplus::Bitmap* pBitmap = Gdiplus::Bitmap::FromHBITMAP( hBitmap, NULL ); // &lt;-- problem line
  </code></pre>
  
  <p>The liner error is a LNK2019 and says:
  Error   2   error LNK2019: unresolved external symbol _GdipFree@4 referenced in function "public: static void __cdecl Gdiplus::GdiplusBase::operator delete(void *)" (??3GdiplusBase@Gdiplus@@SAXPAX@Z) </p>
  
  <p>I have included gdiplus.h, windows.h, and #define GDIPVER 0x110</p>
  
  <p>Any idea how to fix this?</p>