Hi all,

right now I'm doing my first stepps in wrapping C++ code by ude of Boost.

So, there's a

template<class TYPE> class _Variable

with ctor, dtor, an inspector

TYPE value() const

and a mutator

void value( const TYPE& value).

The boost wrapper looks like this:

#include <Python.h>
#include <boost/python.hpp>
using namespace boost::python;

#include "./src/varbls.h"


#include <string>
using namespace std;


typedef _Variable<double>  VariableDouble;

BOOST_PYTHON_MODULE(_varbls)
{

    class_<VariableDouble>("VariableDouble")
        .def( init<>())
        .def( init<const double&>())
    ;
}


Nothing special so far. However, what I get upon import is this:

ImportError: /usr/lib/python2.7/site-packages/tau4.DDG/tau4/tau4misc/varbls/cpp/boost/_varbls.so: undefined symbol: _ZN9_VariableIdEC1Ev

The ctor is decl'ed as

_Variable();

and ist's def'ed like so:

template <typename TYPE>
_Variable<TYPE>::_Variable()
: _value( 0)
{
    //ctor
}

To me, everything looks good, but obiously there's something wrong. What do I miss?

Paul

_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to