Boost logo

Boost Users :

Subject: Re: [Boost-users] Problem with 'cannot instantiate abstract class' after switching from BOOST 1.33.0 to 1.34.1 (also VS2005 -> VS2008)
From: Tobias Alte (tobias_alte_at_[hidden])
Date: 2009-03-13 18:56:16


Hi Steven,

And thanks for the reply.

Like I said, we assume that there is a subtle error in our
implementation of the (derived) classes.

Generally speaking we would have the following structure:

Axis [pure virtual, abstract]
{
}

AxisBase : public Axis [abstract due to a few functions, Could that be
an issue???]
{
}

AxisAlpha : public AxisBase [actual implementations]
{
}

On another note: All of this is legacy code so I can't really mess
around to much with it or post complete parts - not that I think it
would really help.

Again I was just looking for maybe another hint on 'how' to proceed and
maybe leverage certain tricks in BOOST or VS2008 that I don't know yet :)

In any case thanks a lot again for even reading this gibberish!

A full error message would be:

----------------------------------------------------------------------
[...]\boost\concept_check.hpp(250) : error C2259: 'MotionControl::Axis':
cannot instantiate abstract class due to following members:

'MotionControl::MoCon &MotionControl::Axis::MoCon(void)' : is abstract
[...]\main\applications\motion\axis.hpp(75) : see declaration of
'MotionControl::Axis::MoCon'

'boost::shared_ptr<T> MotionControl::Axis::Motor(unsigned int)' : is
abstract
with
[
     T=MotionControl::Motor
]
[...]\main\applications\motion\axis.hpp(81) : see declaration of
'MotionControl::Axis::Motor'

'const MotionControl::MotorIdList
&MotionControl::Axis::MotorIdList(void)' : is abstract
[...]\main\applications\motion\axis.hpp(86) : see declaration of
'MotionControl::Axis::MotorIdList'

'const MotionControl::MotorList &MotionControl::Axis::MotorList(void)' :
is abstract
[...]\main\applications\motion\axis.hpp(91) : see declaration of
'MotionControl::Axis::MotorList'

'unsigned int MotionControl::Axis::Info(MotionControl::Info &)' : is
abstract
[...]\main\applications\motion\axis.hpp(99) : see declaration of
'MotionControl::Axis::Info'

'bool MotionControl::Axis::InfoMotor(MotionControl::Info &,unsigned
int)' : is abstract
[...]\main\applications\motion\axis.hpp(106) : see declaration of
'MotionControl::Axis::InfoMotor'

'MotionControl::Status
MotionControl::Axis::SetPosition(MotionControl::Parameter::PositionTarget::value_type)'
: is abstract
[...]\main\applications\motion\axis.hpp(123) : see declaration of
'MotionControl::Axis::SetPosition'

[...]\include\dataobject.h(747) : see reference to class template
instantiation 'boost::CopyConstructibleConcept<TT>' being compiled
with
[
     TT=MotionControl::Axis
]
[...]\include\dataobject.h(1444) : see reference to class template
instantiation 'Data<_type>' being compiled
with
[
     _type=MotionControl::Axis
]
[...]\include\propertycontainer.h(1159) : see reference to function
template instantiation 'DataObjectPtr
CreateDataObject<MotionControl::Axis>(boost::shared_ptr<T>)' being compiled
with
[
     T=MotionControl::Axis
]
[...]\main\applications\stage\stagemotion.cxx(4922) : see reference to
function template instantiation 'void
PropertyContainer::UpdateProperty<StageControl::StageMotionProperty::AxisOptics>(const
StageControl::StageMotionProperty::AxisOptics::value_type &,bool)' being
compiled
----------------------------------------------------------------------------

On 3/13/2009 1:50 PM, Steven Watanabe wrote:
> AMDG
>
> Tobias Alte wrote:
>> After switching from BOOST 1.33.0 to 1.34.1 (and also from VS2005 ->
>> VS2008) we got a couple of problems with "cannot instantiate abstract
>> class" errors.
>>
>> The application compiles fine in the setup VS2005 + BOOST 1.33.0 but
>> suddenly started to throw a couple of "cannot instantiate abstract
>> class" errors when using VS2008 + BOOST 1.34.1 .
>>
>> The errors itself get reported for 'concept_check.hpp' but that header
>> did not change between the two BOOST releases (as far as I know - I
>> think I made a diff with no results).
>>
>> I believe that the issue is most likely related to the
>> boost::shared_ptr's to templated classes in our code.
>>
>> I already solved a few of these errors that arose thanks to slightly
>> different types in the method definitions thanks to VS2008 having more
>> built in types.
>>
>> However, the current "cannot instantiate abstract class" errors are
>> persistently eluding my grasp. And the compiler is not helpful with
>> just reporting the error in 'concept_check.hpp' and not where it
>> really is.
>
> Can you post the full error message?
>
> In Christ,
> Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net