title: Undefined reference to CreateCompatibleDC, BitBlt, etc.?
body: <p>I already linked to gdi32.lib. In desperation, I also linked to two different versions of gdi32.lib, as well as gdiplus.lib, and included all the gdi headers I could find, to no avail. However, this problem began before the extra links, so I think I can safely assume my problem isn't collisions between libraries or any sort of interference like that.</p>
  
  <p>Inclusions/definitions:</p>
  
  <pre><code>#define WINVER 0x0500
  #define _WIN32_WINNT 0x0500
  #include &lt;iostream&gt;
  #include &lt;process.h&gt;
  #include &lt;windows.h&gt;
  #include &lt;winuser.h&gt;
  #include &lt;gdiplus.h&gt;
  #include "UVMap.h"
  </code></pre>
  
  <p>Related code:</p>
  
  <pre><code>case WM_PAINT:{
          PAINTSTRUCT ps;
          HDC hdc = BeginPaint(hwnd, &amp;ps);
          HDC hdcMemory = CreateCompatibleDC(hdc);
          BITMAP bmp = screen.getBitmap(hdcMemory);
          BitBlt(hdc,0,0,w,h,hdcMemory,0,0,SRCCOPY);
          EndPaint(hwnd,&amp;ps);
          DeleteDC(hdc);
      }break;
  </code></pre>
  
  <p>Every result I found when searching for this problem claimed that you just had to link to gdi32. Here are the links I added:</p>
  
  <ul>
  <li>C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64\Gdi32.Lib</li>
  <li>C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\Gdi32.Lib</li>
  <li>C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\GdiPlus.lib</li>
  </ul>
  
  <p>Edit: the errors appear like this:</p>
  
  <pre><code>.../Testing.cpp:50: undefined reference to `CreateCompatibleDC@4'
  .../Testing.cpp:52: undefined reference to `BitBlt@36'
  </code></pre>
  
  <p>Like that? I did the linking in Eclipse, via Project > Properties > Path Variables. There are no entries under the Linked Resources tab, nor does it appear editable.</p>