Boost logo

Boost :

From: cartersanders (boost_at_[hidden])
Date: 2002-01-30 11:26:24


        I seem to have succesfully installed Boost, which I am using to
access C++ functions from python, and I am having a problem I don't
understand at all.

        I succesfully compiled and ran the getting_started2 code, but
when I try to build a shared library of a certain module, I get the following

>>> import CrGammaMod
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: dynamic module does not define init function

But I have defined it! Code below:
    // Create an object representing this extension module.
    python::module_builder this_module("CrGammaMod");

    // Create the Python type object for our extension class.
    python::class_builder<CrGamma> CrGamma_class(this_module,

    // Add the __init__ function.

    // Add a regular member function.
    python::handle_exception(); // Deal with the exception for Python

Here is my null constructor prototype:
   class CrGamma

and my constructor:
      int a=5;

Why the heck doesn't this work!??? Is there a chance I am doing
something broken with namespaces?


Boost list run by bdawes at, gregod at, cpdaniel at, john at