Hi Mark, Thanks a lot for your great help. Unfortunately, we don't seems to understand what do you mean by "Object". Is it something we need to define or is it already defined in a h file that we forgot to include. We use Linux/gcc environment. Also, in our sample, we did not use virtual function Below, for all of us we are using the WEB to look at the SIG C++ posting , please find the project files. Thanks, Ephi. ======================================================================== // c_spam.cpp #include "spam.h" extern "C" Spam* new_Spam(int a, int b) { Spam* spam = new Spam(a, b); return spam; } extern "C" void Spam_Display(Spam* spam) { spam->Display(); } extern "C" void delete_Spam(Spam* spam) { delete spam; } ======================================================================== // c_spam.h #include "spam.h" extern "C" Spam* new_Spam(int a, int b); extern "C" void Spam_Display(Spam* spam); extern "C" void delete_Spam(Spam* spam); ======================================================================== // ext_spam.cpp // spam extension module. #include "Python.h" #include "c_spam.h" static PyObject* ext_new_Spam(PyObject* self, PyObject* args) { int a, b; if (!PyArg_ParseTuple(args, "ii", &a, &b)) return NULL; Spam* spam = new_Spam(a, b); return Py_BuildValue("O", spam); } static PyObject* ext_Spam_Display(PyObject* self, PyObject* args) { Spam* spam; if (!PyArg_ParseTuple(args, "O", &spam)) return NULL; Spam_Display(spam); return Py_BuildValue(""); } static PyObject* ext_delete_Spam(PyObject* self, PyObject* args) { Spam* spam; if (!PyArg_ParseTuple(args, "O", &spam)) return NULL; delete_Spam(spam); return Py_BuildValue(""); } // "method table" static PyMethodDef c_spamMethods[] = { {"new_Spam", ext_new_Spam, 1}, {"Spam_Display", ext_Spam_Display, 1}, {"delete_Spam", ext_delete_Spam, 1}, {NULL,NULL} }; file://Initialization function that registers new methods with Python interpreter. extern "C" void initc_spam() { PyObject *m; m= Py_InitModule("c_spam", c_spamMethods); } ======================================================================== #makefile PPFLAGS = -fpic LFLAGS = CPP = g++ INCLUDE = /usr/include/python1.5 SOURCES = spam.cpp c_spam.cpp ext_spam.cpp OBJECTS = spam.o c_spam.o ext_spam.o TARGET = c_spammodule.so ####### Implicit rules .SUFFIXES: .cpp .cpp.o: $(CPP) $(CPPFLAGS) -c -I$(INCLUDE) $< ####### Build rules all: $(TARGET) $(TARGET): $(OBJECTS) $(CPP) -shared $(OBJECTS) -o $(TARGET) showfiles: @echo $(SOURCES) makefile clean: rm -f *.o rm -f $(TARGET) rm -f tags rm -f core ======================================================================== run: #!/usr/bin/python import c_spam myspam=c_spam.new_Spam(8, 5) c_spam.Spam_Display(myspam) c_spam.delete_Spam(myspam) print "python end" ======================================================================== // spam.cpp #include <iostream> #include "spam.h" Spam::Spam(int a, int b) : m_a(a), m_b(b) { cout << endl; cout << "In Spam::Spam, "; cout << "m_a = " << m_a << " m_b = " << m_b << endl; } void Spam::Display() { cout << "In Spam::Display, "; cout << "m_a = " << m_a << " m_b = " << m_b << endl; } Spam::~Spam() { cout << "In Spam::~Spam, "; cout << "m_a = " << m_a << " m_b = " << m_b << endl; } ======================================================================== // spam.h class Spam { public: Spam(int a, int b); void Display(); ~Spam(); private: int m_a; int m_b; }; ========================================================================