c++ - ImportError: dynamic module does not define init function, but it does -


i'm trying write binding vendor c++ library. i've used snippets such below define init functions in other modules, in 1 doesn't seem work: compiles fine, throws importerror try import test script. wrong here?

#ifndef pymodinit_func  /* declarations dll import/export */ #define pymodinit_func void #endif pymodinit_func initclient(void) {      pyobject* m;      clienttype.tp_new = pytype_genericnew;     if (pytype_ready(&clienttype) < 0)         return;      m = py_initmodule3("client", client_methods, "client module");     py_incref(&clienttype);     pymodule_addobject(m, "client", (pyobject *) &clienttype);  } 

this on 32-bit linux, gcc 4.4.4.

i had same issue. @ compile time:

  • path python header: ok
  • path python library: ok
  • link against python library: ok
  • link against needed third parties libraries/object files: ok

i forgot compile c file defines module... sigh...

so yeah, first thing check: makefile or compilation command! :)


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -