[Cython] Fwd: [cython-users] How cythonize support c++?

Stefan Behnel stefan_ml at behnel.de
Sun Nov 10 12:29:10 CET 2013

Given how often this has come up already, we should consider it a major
usability issue.

IMHO, stricter argument validation in cythonize() would help, as would
better documentation about which option to use where.


-------- Original-Message --------
Subject: [cython-users] How cythonize support c++?
Date: Sun, 10 Nov 2013 19:19:48 +0800
To: cython-users at googlegroups.com

Hi All

   I encountered a problem on writing a setup.py for cython extension.
Following a tutorial from cython.org I wrote some codes like:

from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize

setup(cmdclass={'build_ext':build_ext}, ext_modules = cythonize("my.pyx",

when I typed python setup.py build_ext --inplace on windows 7 with cython
It complained a lot of error.

I founded out if I write setup file like this:

extModules = [Extension("my", sources=["my.pyx"],language="c++")]
setup(cmdclass={'build_ext':build_ext}, ext_modules=extModules)

It ran fine without any problem.

Do I miss sth so that cythonize can't support c++ ?


gelin yan

More information about the cython-devel mailing list