ImportError: dynamic module does not define init function 
Author Message
 ImportError: dynamic module does not define init function

I'm trying to build a python extension and after building the shared
library
I get

      ImportError: dynamic module does not define init function
(initascend)

when I import the module. Of course I have that method in the code

   void initascend(void) {
      Py_InitModule("ascend",ascendmethods);
   }


00027ba8 T initascend

I now little about about python extensions and shared libraries (by the
way
can someone point me a book or link on the topic of shared libraries
debugging).
Can someone give a me tip on how to solve this?

Thanks

pedro lima



Mon, 19 May 2003 03:00:00 GMT  
 ImportError: dynamic module does not define init function

Quote:

> I'm trying to build a python extension and after building the shared
> library
> I get

>       ImportError: dynamic module does not define init function
> (initascend)

> when I import the module. Of course I have that method in the code

>    void initascend(void) {
>       Py_InitModule("ascend",ascendmethods);
>    }

You need to export the symbol from the DLL by using:

     void __declspec(dllexport) initascend()

JimA



Tue, 20 May 2003 03:00:00 GMT  
 ImportError: dynamic module does not define init function


Quote:

> > I'm trying to build a python extension and after building the shared
> > library I get

> >       ImportError: dynamic module does not define init function
> > (initascend)

> > when I import the module. Of course I have that method in the code

> >    void initascend(void) {
> >       Py_InitModule("ascend",ascendmethods);
> >    }

> You need to export the symbol from the DLL by using:

>      void __declspec(dllexport) initascend()

This works in VC++6, only, so you may want to bracket the __declspec
with the appropriate #ifdef.

Alternatively, a distutils setup.py uses a differend and more portable
way (it tells the linker directly to expose the initwhatever from the
.PYD file).  Using distutils might be the simplest solution...

Alex



Thu, 22 May 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. SWIG: ImportError: dynamic module does not define init function

2. Pickler that handles modules, functions, and builtin functions -- done

3. wxPython+py2exe+win98 ImportError: DLL load failed: A device attached to the system is not functioning

4. Extension Module init function names

5. PyType_GenericNew not calling Init/New functions

6. Calling functions defined in modules in Python from C++

7. array-function not defined?

8. Can TPB be defined outside defining modules?

9. ??? module function in the interface of a module function

10. ImportError: No module named win32api

11. ImportError: No module named win32com.client" error

12. ImportError: No module named _tkinter

 

 
Powered by phpBB® Forum Software