extending python

A

Ajay

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
 
M

Michael Hudson

Ajay said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top