title: Building Pillow for PyPy - unresolved externals
body: <p>I've been struggling with building Pillow for PyPy (2.1) on my Windows (XP) installation, using easy_install.
  Problems seems to be related to it missing needed python/pypy header(?). I've been searching Google both up and down  for days, hoping to find a few who could elaborate on the problems I am having, but not finding anything helpful.  </p>
  
  <p>The error log I am getting is:</p>
  
  <pre><code>...
  
  C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox
  /MD /W3 /GS- /DNDEBUG -IlibImaging -IC:\pypy-21\include -IC:\pypy-21\include /Tc
  libImaging\UnsharpMask.c /Fobuild\temp.win32-2.7\Release\libImaging\UnsharpMask.obj
  
  ...
  decode.obj : error LNK2001: unresolved external symbol __imp__PyType_Type
  encode.obj : error LNK2001: unresolved external symbol __imp__PyType_Type
  map.obj : error LNK2001: unresolved external symbol __imp__PyType_Type
  encode.obj : error LNK2019: unresolved external symbol __imp___PyString_Resize r
  eferenced in function __encode
  encode.obj : error LNK2019: unresolved external symbol __imp__PyErr_SetFromErrno
   referenced in function __encode_to_file
  encode.obj : error LNK2019: unresolved external symbol __imp__PyExc_SystemError
  referenced in function __setimage
  display.obj : error LNK2019: unresolved external symbol __imp__PyList_Append ref
  erenced in function _list_windows_callback@8
  display.obj : error LNK2019: unresolved external symbol __imp__PyErr_Print refer
  enced in function _callback_error
  display.obj : error LNK2019: unresolved external symbol __imp__PyFile_WriteStrin
  g referenced in function _callback_error
  display.obj : error LNK2019: unresolved external symbol __imp__PySys_GetObject r
  eferenced in function _callback_error
  display.obj : error LNK2019: unresolved external symbol _PyObject_CallFunction r
  eferenced in function _windowCallback@16
  path.obj : error LNK2001: unresolved external symbol _PyObject_CallFunction
  display.obj : error LNK2019: unresolved external symbol __imp__PyThreadState_Swa
  p referenced in function _windowCallback@16
  display.obj : error LNK2019: unresolved external symbol __imp__PyThreadState_Get
   referenced in function _PyImaging_CreateWindowWin32
  path.obj : error LNK2019: unresolved external symbol __imp__PyErr_ExceptionMatch
  es referenced in function _PyPath_Flatten
  path.obj : error LNK2019: unresolved external symbol __imp__PyNumber_Check refer
  enced in function _PyPath_Flatten
  path.obj : error LNK2019: unresolved external symbol __imp__PyExc_RuntimeError r
  eferenced in function _path_clip_polygon
  build\lib.win32-2.7\_imaging.pypy-21.pyd : fatal error LNK1120: 61 unresolved ex
  ternals
  error: command 'C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.e
  xe' failed with exit status 1120
  </code></pre>
  
  <p>I really struggle to see why this is happening, I actually have no clue. I am easily able to build packages for CPython. </p>
  
  <p>As far as I see dependencies folder is included as well: "-IC:\pypy-21\include"(?).</p>
  
  <p>For more of the log you can look at <a href="http://pastebin.com/raw.php?i=kKnNpRgr" rel="nofollow">http://pastebin.com/raw.php?i=kKnNpRgr</a></p>
  
  <p><strong>Edit - The solution</strong></p>
  
  <p>After grabbing PyPy 2.2.1 I found that I was indeed missing some files in my "PyPy-21/Include"-path. And so.. Pillow installed just fine with the newfound header, and it's running flawlessly! =)</p>