title: error LNK2001: unresolved external symbol _IID_IDirectDraw2
body: <p>I work with piece of legacy code which uses direct draw and I'm in rather embarrassing situation.
  Not long ago I've updated my system and had to adapt to the new situation (loading ddraw.dll) and everything worked fine.
  Today I explored another legacy solution which also uses classes (files) I've changed, but I'm stuck with above mentioned linking error. I've checked and compared project properties and they seam fine.</p>
  
  <p>This is code for directX initialization, "troublesome" code is bold.</p>
  
  <pre><code> typedef int (__stdcall *DirectDrawCreateFunc)(GUID FAR* a ,LPDIRECTDRAW FAR* b, IUnknown FAR* c);
  
      /* init_directx:
       *  Low-level DirectDraw initialization routine.
       */
      int CDCUtils::init_directx(HWND allegro_wnd)
      {
         LPDIRECTDRAW directdraw1;
         HRESULT hr;
         LPVOID temp;
         HINSTANCE ddraw = LoadLibrary("%WINDIR%\system32\ddraw.dll");
         if(ddraw== NULL)
         {
             return -1;
         }
         _ddrawLib =ddraw;
      DirectDrawCreateFunc ddFunc = (DirectDrawCreateFunc)GetProcAddress(ddraw,"DirectDrawCreate");
      if(ddFunc)
      {
       /* first we have to set up the DirectDraw1 interface... */
         hr = ddFunc(NULL, &amp;directdraw1, NULL);
         if (FAILED(hr))
            return -1;
      }
  
         ///* first we have to set up the DirectDraw1 interface... */
         //hr = DirectDrawCreate(NULL, &amp;directdraw1, NULL);
         //if (FAILED(hr))
         //   return -1;
  
         //...then query the DirectDraw2 interface
         //This is the only place where IID_IDirectDraw2 is mentioned in entire solution
         hr=directdraw1-&gt;QueryInterface(IID_IDirectDraw2, &amp;temp);
         if (FAILED(hr))
            return -1;
  
         _directdraw = (LPDIRECTDRAW2)temp;
         directdraw1-&gt;Release();
  
         /* set the default cooperation level */
         hr = IDirectDraw2_SetCooperativeLevel(_directdraw, allegro_wnd, DDSCL_NORMAL);
         if (FAILED(hr))
            return -1;
  
         /* get capabilities */
         _ddcaps.dwSize = sizeof(_ddcaps);
         hr = IDirectDraw2_GetCaps(_directdraw, &amp;_ddcaps, NULL);
         if (FAILED(hr)) {
            TRACE("Can't get driver caps\n");
            return -1;
         }
  
         _dxHwnd=allegro_wnd;
        return 0;
      } 
  </code></pre>
  
  <p>Any ideas?
  Why it works in one solution and not in this one?
  Oh linker I loathe thee. </p>