Embedding from C++: ImportError: /path/to/pydmanager.so: undefined symbol: FMtype

Alex Farber alex at kawo2.rwth-aachen.de
Tue Jan 11 22:12:54 EST 2000


Dear colleagues,

I have to take over some C++ program which embeds Python.
Unfortunately I am new to Python and I also don't understand
the program source yet. So I am reading documentation. However 
if someone has an idea, why do I get this error message
(nm --dynamic pyfemmesh.so |c++filt |grep -i fmtype
 prints: "00007d40 D FMtype" and LD_LIBRARY_PATH is set):

  Traceback (innermost last):
    File "/home/alex/.viewer2/pystartup.py", line 6, in ?
      from pydmanager import *
  ImportError: /path/to/pydmanager.so: undefined symbol: FMtype

I would be very glad to hear it. Otherwise/anyway I will 
keep reading (any online-pointers for embedding Python?). 

Thank you
/Alex



Here is an excerpt from pyfemmesh.h
-----------------------------------
extern PyTypeObject FMtype;



Here is an excerpt from pyfemmesh.cc
------------------------------------
static char FMtype__doc__[] =
"MeshType - is equivalent to FemMesh, uses FemMEsh::SmPtr"
;

PyTypeObject FMtype = {
        PyObject_HEAD_INIT(&PyType_Type)
        0,                              /*ob_size*/
        "Mesh",                 /*tp_name*/
        sizeof(FMobject),               /*tp_basicsize*/
        0,                              /*tp_itemsize*/
        /* methods */
        (destructor)FM_dealloc, /*tp_dealloc*/
        (printfunc)FM_print,            /*tp_print*/
        (getattrfunc)FM_getattr,        /*tp_getattr*/
        (setattrfunc)0, /*tp_setattr*/
        (cmpfunc)0,             /*tp_compare*/
        (reprfunc)0,            /*tp_repr*/
        0,                      /*tp_as_number*/
        0,              /*tp_as_sequence*/
        0,              /*tp_as_mapping*/
        (hashfunc)0,            /*tp_hash*/
        (ternaryfunc)0,         /*tp_call*/
        (reprfunc)0,            /*tp_str*/

        /* Space for future expansion */
        0L,0L,0L,0L,
        FMtype__doc__ /* Documentation string */
};



Here is the content of pystart.py
----------------------------------
# Python default startup file
import sys
import pyfempool
import pyfemmesh
import pyfilehandlers
from pydmanager import *
import vlib
# import simba
print "Default modules loaded\n"



More information about the Python-list mailing list