[Pythonmac-SIG] Extending python in C++

Daniel Lord dmlsj@yahoo.com
Mon, 9 Dec 2002 19:25:09 -0800


Matt,
Go to the Python Language site and click on the Documentation Link, 
there is a tutorial there about extending Python in C.

URL: http://www.python.org/doc/current/ext/ext.html

Remember, C++ needs to be wrapped in the extern macro for APIs 
expecting C code. I believe that if you do that while following the 
tutorial, you'll have your problem solved.

Daniel
--
daniellordATtelocityDOTcom
GPG Fingerprint: C59E 59F5 1C63 5CFB 6161 067E FF00 A4E8 684A 16BB

perl -le '$_="6110>374086;2064208213:90<307;55";tr[0->][ 
LEOR\!AUBGNSTY];print;'



On Monday, Dec 9, 2002, at 18:26 US/Pacific, Matthew Smith wrote:

> Hello
>
> Sorry that this is not mac related,
>
> I'm trying to extend python with some C++ source, only I am having
> difficulty exporting my init function. More specifically, when I try to
> import my module (demo.so), I get the following error:
> Loaded module does not contain symbol _initdemo
>
> My source does contain the following function:
>
> void initdemo()
> {
>     Py_InitModule("demo", demoMethods);
> }
>
> I'm assuming that this function either somehow needs to be exported, 
> or is
> being optimised out.
>
> Any suggestions?
>
> Matt Smith
>
>
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
>
>
>