Stefan Seefeld wrote:

> On 10/26/2012 07:42 AM, Paul O. Seidon wrote:
>> Hi all,
>>
>> right now I'm doing my first stepps in wrapping C++ code by ude of Boost.
> 
> [...]
> 
> Where is the definition of your _Variable template instances ? Your
> newly compiled Python module can't find them. The likely cause is that
> you forgot to link the module to the library containing the definition(s).
> 
>     Stefan
> 
> 

Not sure what you mean:

The ctor is decl'ed in varbls.h as

_Variable();

and it's def'ed in varbls.cpp like so:

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


I did a typedef in the wrapper and wrote

BOOST_PYTHON_MODULE(_varbls)
{

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

in the wrapper. 

Any instance of VariableDouble should then be def'ed in the importing Python 
module.

Everything works fine if I do not use templates but plain C++ classes 
instead.


Paul


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

Reply via email to