cannot declare variable ‘’ to be of abstract type ‘’

The reason the base class is abstract is this pure virtual function:

virtual btScalar addSingleResult(
  btManifoldPoint& cp,
  const btCollisionObjectWrapper* colObj0Wrap,
  int partId0,
  int index0,
  const btCollisionObjectWrapper* colObj1Wrap,
  int partId1,
  int index1) = 0;

The derived class DisablePairCollision attempts to define that function, but it does not do it correctly:

virtual btScalar addSingleResult(
   btManifoldPoint& cp,
   const btCollisionObject* colObj0,
   int32_t partId0,
   int32_t index0,
   const btCollisionObject* colObj1,
   int32_t partId1,
   int32_t index1);

As you can see, some of the arguments have different types. E.g. colObj0 is of type const btCollisionObject*, but it should be of type const btCollisionObjectWrapper*.

Therefore, the derived class defines a new function with different arguments, but it does not define the pure virtual function from the base class, hence the derived class is still abstract.

You need to define the function with the exact same argument types as in the base class.

Leave a Comment

error code: 523