I’m using distutils, and have a module spammodule.c that compiles,links and works perfectly.
But if I rename that module to .cpp and re-run the distutils build/install sequence, the module builds but gives me an error on import in python:
ImportError: dynamic module does not define init function (initspam)
Is there a different format for new modules in CPP rather than C ?
You need to enclose your init function within
in order to prevent its name from getting mangled.