[C++-sig] A few questions about embedding python

Nicolas Lelong nico_ml at mgdesign.org
Wed Mar 16 11:22:40 CET 2005


Hi,

> ?? Do I need static linking on windows for embedding?

It seems that you answered your own question, as it runs fine with the DLL, 
embedding is OK with dynamic linking. If you absolutely need static linking 
with BPL, perhaps you could send a sample of those linking errors you 
mentionned.

> Most of the examples I've seen importing c++ classes are when they are
> extending python not embedding. Do I need to use Python C/API to
> import my truckstate module or something??

You effectively have to "declare" your module by calling :

PyImport_AppendInittab("truckstate", inittruckstate);

before the Py_Initialize() call, and I think that should do the trick !

HTH,

Nicolas. 




More information about the Cplusplus-sig mailing list