title: How to create a Direct2D factory
body: <p>I am creating a Direct2D application and the API overview page says the first step is to create a factory... well I tried that with this function</p>
  
  <pre><code>D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &amp;factory);
  </code></pre>
  
  <p>but it gives the error</p>
  
  <pre><code>Error   62  error LNK2019: unresolved external symbol _D2D1CreateFactory@16 referenced in function "long __cdecl D2D1CreateFactory(enum D2D1_FACTORY_TYPE,struct _GUID const &amp;,void * *)" (?D2D1CreateFactory@@YAJW4D2D1_FACTORY_TYPE@@ABU_GUID@@PAPAX@Z
  </code></pre>
  
  <p>I am calling the D2D1CreateFactory function from within the WinMain function.</p>
  
  <p>This is how I initialized the factory pointer</p>
  
  <pre><code>ID2D1Factory *factory;
  </code></pre>
  
  <p>These are the Include and Library Directories</p>
  
  <pre><code>C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include
  C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86
  </code></pre>
  
  <p>I have experience with direct3D so I am familiar with devices and render targets, but I was under the impression that for direct2D the factory comes first so I haven't created any devices, render targets, etc...</p>
  
  <p>Any help is appreciated.</p>