Can't redirect error stream from Cython
问题 The SFML library that I'm trying to cythonize defines this function below that allows to change where errors are printed to (by default SFML writes error messages to the console when this function is not called): namespace sf { std::ostream& err() { static DefaultErrStreamBuf buffer; static std::ostream stream(&buffer); return stream; } } My simplified .pxd file for the above function: cdef extern from 'SFML/System.hpp' namespace 'sf': ostream& cerr 'sf::err' () And my .pyx module, which