Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   extending python (http://www.velocityreviews.com/forums/t336338-extending-python.html)

Ajay 09-29-2004 06:03 AM

extending python
 
hi!

does the init<modulename> function has to have a PyMODINIT_FUNC return
type.
i am building PyOpenSSL for a pocket pc using embedded visual c++ and i am
doing so by putting together all the C files together for OpenSSL/crypto
and building crypto.pyd
now crypto.c has void initcrypto

Build works fine. But when i import it, i get an error saying dynamic load
module does not define an init function (initcrypto)
the same build using VC++ 6.0 works fine on the PC and i can even import
it.

any ideas?

thanks

cheers






----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Michael Hudson 09-29-2004 12:05 PM

Re: extending python
 
Ajay <abra9823@mail.usyd.edu.au> writes:

> hi!
>
> does the init<modulename> function has to have a PyMODINIT_FUNC
> return type.


Well, er, it has to have certain things declared about it in some
circumstances and PyMODINIT_FUNC is probably the easiest way to
acheive this. Woolly enough for you? :-)

> i am building PyOpenSSL for a pocket pc using embedded visual c++ and i am
> doing so by putting together all the C files together for OpenSSL/crypto
> and building crypto.pyd
> now crypto.c has void initcrypto
>
> Build works fine. But when i import it, i get an error saying dynamic load
> module does not define an init function (initcrypto)
> the same build using VC++ 6.0 works fine on the PC and i can even import
> it.
>
> any ideas?


Well, I guess your module init function *is* declared a
PyMODINIT_FUNC? Can you find out what it is expanding to? I guess
it's not right?

I think it needs to be __declspec(export) or something like that (but
I'm not a Windows user; don't take my word for it).

Cheers,
mwh

--
We've had a lot of problems going from glibc 2.0 to glibc 2.1.
People claim binary compatibility. Except for functions they
don't like. -- Peter Van Eynde, comp.lang.lisp


All times are GMT. The time now is 10:50 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.