title: How do I get Cython to use an object file?
body: <p>I have used the NASM assembler to compile a simple assembly file (code below). I am going to then attempt to take this <code>.obj</code> file created, and have Cython link it to a <code>.pyd</code> file, so Python can import it. Basically I need a way of telling Cython to include an <code>.obj</code> file for use with other Cython / Python code.</p>
  <p>First, here is my assembly code:</p>
  <h2>myfunc.asm</h2>
  <pre><code>;http://www.nasm.us/doc/nasmdoc9.html
  global  _myfunc 
  section .text
  _myfunc:
      push    ebp 
      mov     ebp,esp 
      sub     esp,0x40        ; 64 bytes of local stack space 
      mov     ebx,[ebp+8]     ; first parameter to function
      ; some more code 
      leave
      ret
  </code></pre>
  <p>I compile this code by using <code>nasm -f win32 myfunc.asm</code></p>
  <p>This gives me <code>myfunc.obj</code>, which is what I want to include into a Cython compiled <code>.pyd</code>.</p>
  <p>I may be completely mislead, and there may be a better method to do this entirely. Is there a simple one liner <code>extern</code> that I can do to declare an external object from Cython?</p>
  <p>P.S. The label <code>_myfunc</code> should be the entry point.</p>