[C++-sig] [SOLVED] Re: [boost.python] Can't import a wrapped template class

Paul O. Seidon p.oseidon at datec.at
Sat Oct 27 09:05:07 CEST 2012


Paul O.  Seidon wrote:

<snip>

> That didn't make any difference. And it would have surprised me, if it
> did: varbls.h contains the declaration, varbls.cpp contains the
> definition, the wrapper is in main.cpp. So if the compiler sees any need
> to include sometihng, it will and the linker will link the definition.

Well, it *makes* a difference if *all* of _Variable<TYPE> is moved from the 
cpp- to the h-file (as suggested by Stefan yesterday evening). Alex, I did 
the explicit template class instantiation (thanks for the hint) w/o success 
at first. Then I saw that I forgot to def the dtor in the h-file. Did it and 
*it worked*. I then even could remove the explicit template class 
instantiation.

Thanks to you both keeping up with me doing the first steps in boost and the 
first steps in C++ after a pause of about 8 years. It's definitely worth 
using boost.python as it seems "lightning fast".

Paul





More information about the Cplusplus-sig mailing list