D
D
DTPlayer2021-07-22 17:28:05
Python
DTPlayer, 2021-07-22 17:28:05

Why doesn't Cython compile?

I am running this batch:

set PROJECT_NAME=program
set PYTHON_DIR=C:\Users\<user>\AppData\Local\Programs\Python\Python39
%PYTHON_DIR%\python -m cython --embed -o %PROJECT_NAME%.c %PROJECT_NAME%.py
gcc -Os -I %PYTHON_DIR%\include -o %PROJECT_NAME%.exe %PROJECT_NAME%.c -lpython39 -lm -L %PYTHON_DIR%\libs

The result is an error:
program.c -lpython39 -lm -L C:\Users\<user>\AppData\Local\Programs\Python\Python39\libs
program.c:203:41: warning: division by zero [-Wdiv-by-zero]
     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
                                         ^
program.c:203:12: error: enumerator value for '__pyx_check_sizeof_voidp' is not an integer constant
     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };

How to solve it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2021-07-22
@DTPlayer

Try adding gcc to pass parameter -DMS_WIN64

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question