Skip to content Skip to sidebar Skip to footer

Can I Use Mingw Compiled Python Extensions Together With Visual C++ Compiled Ones?

Having trouble compiling a Python extension under Windows, I've asked a question.One of the answers does not answer my question but is worth asking as a question on its own. Given

Solution 1:

It's not officially supported, but I think it should work. Python exposes extern "C" functions (with C linkage), so you should be able to call them from MSVC. But that's only Python itself. What about extensions? PyMODINIT_FUNC also has extern "C" in it, so that allows to call it from MSVC, too. Functions that you pass to Python by function pointer should also work, because they use cdecl calling convention by default, but do not need C linkage (or C name mangling) because they are called by pointer. To sum up, it should Just Work™.


Post a Comment for "Can I Use Mingw Compiled Python Extensions Together With Visual C++ Compiled Ones?"