title: How to compile __init__.py file using cython on Windows
body: <p>When I compile an arbitrary __init__.py file on Windows with <code>setup.py build_ext --inplace</code> command, it has an unresolvable external symbol error (i.e. &quot;LINK : error LNK2001: An unresolvable external symbol PyInit___init__&quot;).</p>
  <p>The local environment:</p>
  <pre><code>python3.7,
  Cython 0.29.14,
  window10 x64,
  Microsoft Visual Studio 2017,
  </code></pre>
  <p>ctest/__init__.py</p>
  <pre><code># cython: language_level=3
  print('__init__')
  
  </code></pre>
  <p>setup.py</p>
  <pre class="lang-py prettyprint-override"><code>from distutils.core import setup
  from Cython.Build import cythonize
  
  
  def compile_code(name, filename):
      setup(
          name=name,
          ext_modules=cythonize(filename),
      )
  
  
  if __name__ == '__main__':
      compile_code('a', 'ctest/__init__.py')
  
  </code></pre>
  <p>The information printed by the terminal:</p>
  <pre><code>Compiling ctest/__init__.py because it changed.
  [1/1] Cythonizing ctest/__init__.py
  running build_ext
  building 'ctest.__init__' extension
  creating build
  creating build\temp.win-amd64-3.7
  creating build\temp.win-amd64-3.7\Release
  creating build\temp.win-amd64-3.7\Release\ctest
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Id:\py37\include -Id:\py37\incl
  ude &quot;-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include&quot; &quot;-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um&quot; &quot;-IC:\Pro
  gram Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt&quot; &quot;-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared&quot; &quot;-IC:\Program Files (x86)\Windows Kits\10\includ
  e\10.0.18362.0\um&quot; &quot;-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt&quot; &quot;-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt&quot; /Tcctest/__init__
  .c /Fobuild\temp.win-amd64-3.7\Release\ctest/__init__.obj
  __init__.c
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTU
  AC:NO /LIBPATH:d:\py37\Libs /LIBPATH:D:\ENVS\cpytrantest\libs /LIBPATH:D:\ENVS\cpytrantest\PCbuild\amd64 &quot;/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC
  \Tools\MSVC\14.16.27023\lib\x64&quot; &quot;/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64&quot; &quot;/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x6
  4&quot; &quot;/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64&quot; /EXPORT:PyInit___init__ build\temp.win-amd64-3.7\Release\ctest/__init__.obj /OUT:C:\Users\76923\Deskto
  p\cpythonrecord\ctest\__init__.cp37-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.7\Release\ctest\__init__.cp37-win_amd64.lib
  LINK : error LNK2001: An unresolvable external symbol PyInit___init__
  build\temp.win-amd64-3.7\Release\ctest\__init__.cp37-win_amd64.lib : fatal error LNK1120: An external command that cannot be parsed
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\link.exe' failed with exit status 1120
  </code></pre>