Can't build anymore my Cython programs with Visual Studio 2026

6 views
Skip to first unread message

Olivier Casile

unread,
Dec 10, 2025, 10:15:06 AM (7 days ago) Dec 10
to cython-users
Hi,

I have been building my Cython programs for years with Visual Studio 2022, without any problem.

But I recently upgraded to Visual Studio 2026, and I now get systematic Link errors:
othpy.obj : error LNK2001: symbole externe non résolu __imp__PyBaseObject_Type
othpy.obj : error LNK2001: symbole externe non résolu __imp__PyObject_SetAttr
othpy.obj : error LNK2001: symbole externe non résolu __imp__PyUnicode_InternFromString
othpy.obj : error LNK2001: symbole externe non résolu __imp__PyCFunction_Type
othpy.obj : error LNK2001: symbole externe non résolu __imp__PyOS_snprintf
etc.

I am using Cython 3.2.2 and Python 3.10

I have checked that the python libraries folder is in the LIBPATH:

And, my Setup.py is rather simple:

from distutils.extension import Extension
from Cython.Build import cythonize
extensions = [
    Extension(
        name="othpy",
        sources=["othpy.pyx"],
        extra_compile_args=["/O2", "/MT"],
    )
]
setup(
    ext_modules=cythonize(extensions),
)

Any clue ? Is anyone else building Cython programs with Visual Studio 2026 ?

Olivier
Reply all
Reply to author
Forward
0 new messages