I am trying to create an executable in cython, following the directions here: Making an executable in Cython. 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.
Edited:
I am currently doing the following things with the following Cython file:
cpdef primes(int kmax):
cdef int n, k, i
cdef int p[1000]
result = []
if kmax > 1000:
kmax = 1000
k = 0
n = 2
while k < kmax:
i = 0
while i < 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
- Running through the command line the commands:
cython primes.pyx --embed
gcc -DMS_WIN64 -mthreads -mconsole -Wall -O -IC:\Python34\include -LC:\Python34\libs setup.c -lpython34 -o example.exe
And the error that I get is:
"c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libmingw32.a(main.o):(.text.startup+0xa7): undefined reference to `WinMain@16'"
Thank you kindly!