title: Creating an executable from Cython Code
body: <p>I am trying to create an executable in cython, following the directions here: 
  <a href="https://stackoverflow.com/questions/22507592/making-an-executable-in-cython">Making an executable in Cython</a>.
  However, I keep getting the error "undefined reference to 'WinMain@16' collect2.exe and I am curious to know what the cause of this is. </p>
  
  <p>Edited: </p>
  
  <p>I am currently doing the following things with the following Cython file: </p>
  
  <pre><code>cpdef primes(int kmax):
  cdef int n, k, i
  cdef int p[1000]
  result = []
  if kmax &gt; 1000:
      kmax = 1000
  k = 0
  n = 2
  while k &lt; kmax:
      i = 0
      while i &lt; k and n % p[i] != 0:
          i = i + 1
      if i == k:
          p[k] = n
          k = k + 1
          result.append(n)
      n = n + 1
  return result
  </code></pre>
  
  <ol>
  <li>Running through the command line the commands: </li>
  </ol>
  
  <p>cython primes.pyx --embed</p>
  
  <p>gcc -DMS_WIN64 -mthreads -mconsole -Wall -O -IC:\Python34\include -LC:\Python34\libs setup.c -lpython34 -o example.exe</p>
  
  <p>And the error that I get is: </p>
  
  <p>"c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libmingw32.a(main.o):(.text.startup+0xa7): undefined reference to `WinMain@16'"</p>
  
  <p>Thank you kindly!</p>