Compile errors with Panda and Bullet

I’m getting some compiler errors building on Linux with Bullet support. I’m sure it’s something simple I’m overlooking …

[T1] Building C++ object built/tmp/p3bullet_composite.o
g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/p3bullet_composite.o -Ibuilt/tmp -Ibuilt/include -I/usr/include/python2.7 -I/usr/include/eigen3 -Ithirdparty/linux-libs-x64/bullet/include -DMAKEPANDA= -Ipanda/src/bullet -pthread -msse2 -O2 -DBUILDING_PANDABULLET panda/src/bullet/p3bullet_composite.cxx
In file included from panda/src/bullet/config_bullet.h:27:0,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
panda/src/bullet/bulletWorld.h:137:23: error: invalid abstract return type for member function ‘BulletContactResult BulletWorld::contact_test(PandaNode*) const’
panda/src/bullet/bulletContactResult.h:56:26: note:   because the following virtual functions are pure within ‘BulletContactResult’:
thirdparty/linux-libs-x64/bullet/include/BulletCollision/CollisionDispatch/btCollisionWorld.h:424:20: note:     virtual btScalar btCollisionWorld::ContactResultCallback::addSingleResult(btManifoldPoint&, const btCollisionObjectWrapper*, int, int, const btCollisionObjectWrapper*, int, int)
panda/src/bullet/bulletWorld.h:138:23: error: invalid abstract return type for member function ‘BulletContactResult BulletWorld::contact_test_pair(PandaNode*, PandaNode*) const’
panda/src/bullet/bulletContactResult.h:56:26: note:   since type ‘BulletContactResult’ has pure virtual functions
In file included from panda/src/bullet/p3bullet_composite.cxx:1:0:
panda/src/bullet/config_bullet.cxx: In function ‘void init_libbullet()’:
panda/src/bullet/config_bullet.cxx:180:27: error: invalid conversion from ‘bool (*)(btManifoldPoint&, const btCollisionObject*, int, int, const btCollisionObject*, int, int)’ to ‘ContactAddedCallback {aka bool (*)(btManifoldPoint&, const btCollisionObjectWrapper*, int, int, const btCollisionObjectWrapper*, int, int)}’ [-fpermissive]
In file included from panda/src/bullet/p3bullet_composite.cxx:3:0:
panda/src/bullet/bulletAllHitsRayResult.cxx: In member function ‘const BulletRayHit BulletAllHitsRayResult::get_hit(int) const’:
panda/src/bullet/bulletAllHitsRayResult.cxx:115:39: error: invalid conversion from ‘const btCollisionObject*’ to ‘btCollisionObject*’ [-fpermissive]
In file included from panda/src/bullet/p3bullet_composite.cxx:8:0:
panda/src/bullet/bulletClosestHitRayResult.cxx: In member function ‘PandaNode* BulletClosestHitRayResult::get_node() const’:
panda/src/bullet/bulletClosestHitRayResult.cxx:78:34: error: invalid conversion from ‘const btCollisionObject*’ to ‘btCollisionObject*’ [-fpermissive]
In file included from panda/src/bullet/p3bullet_composite.cxx:9:0:
panda/src/bullet/bulletClosestHitSweepResult.cxx: In member function ‘PandaNode* BulletClosestHitSweepResult::get_node() const’:
panda/src/bullet/bulletClosestHitSweepResult.cxx:78:34: error: invalid conversion from ‘const btCollisionObject*’ to ‘btCollisionObject*’ [-fpermissive]
In file included from panda/src/bullet/p3bullet_composite.cxx:26:0:
panda/src/bullet/bulletPersistentManifold.cxx: In member function ‘PandaNode* BulletPersistentManifold::get_node0()’:
panda/src/bullet/bulletPersistentManifold.cxx:69:82: error: static_cast from type ‘const btCollisionObject*’ to type ‘btCollisionObject*’ casts away qualifiers
panda/src/bullet/bulletPersistentManifold.cxx: In member function ‘PandaNode* BulletPersistentManifold::get_node1()’:
panda/src/bullet/bulletPersistentManifold.cxx:82:82: error: static_cast from type ‘const btCollisionObject*’ to type ‘btCollisionObject*’ casts away qualifiers
In file included from panda/src/bullet/p3bullet_composite.cxx:42:0:
panda/src/bullet/bulletWorld.cxx: In member function ‘BulletContactResult BulletWorld::contact_test(PandaNode*) const’:
panda/src/bullet/bulletWorld.cxx:690:21: error: invalid abstract return type for member function ‘BulletContactResult BulletWorld::contact_test(PandaNode*) const’
panda/src/bullet/bulletContactResult.h:56:26: note:   since type ‘BulletContactResult’ has pure virtual functions
panda/src/bullet/bulletWorld.cxx:695:23: error: cannot declare variable ‘cb’ to be of abstract type ‘BulletContactResult’
panda/src/bullet/bulletContactResult.h:56:26: note:   since type ‘BulletContactResult’ has pure virtual functions
panda/src/bullet/bulletWorld.cxx:701:10: error: cannot allocate an object of abstract type ‘BulletContactResult’
panda/src/bullet/bulletContactResult.h:56:26: note:   since type ‘BulletContactResult’ has pure virtual functions
panda/src/bullet/bulletWorld.cxx: In member function ‘BulletContactResult BulletWorld::contact_test_pair(PandaNode*, PandaNode*) const’:
panda/src/bullet/bulletWorld.cxx:709:21: error: invalid abstract return type for member function ‘BulletContactResult BulletWorld::contact_test_pair(PandaNode*, PandaNode*) const’
panda/src/bullet/bulletContactResult.h:56:26: note:   since type ‘BulletContactResult’ has pure virtual functions
panda/src/bullet/bulletWorld.cxx:715:23: error: cannot declare variable ‘cb’ to be of abstract type ‘BulletContactResult’
panda/src/bullet/bulletContactResult.h:56:26: note:   since type ‘BulletContactResult’ has pure virtual functions
panda/src/bullet/bulletWorld.cxx:721:10: error: cannot allocate an object of abstract type ‘BulletContactResult’
panda/src/bullet/bulletContactResult.h:56:26: note:   since type ‘BulletContactResult’ has pure virtual functions
panda/src/bullet/bulletBaseCharacterControllerNode.h: At global scope:
panda/src/bullet/bulletBaseCharacterControllerNode.h:46:44: warning: inline function ‘virtual btPairCachingGhostObject* BulletBaseCharacterControllerNode::get_ghost() const’ used but never defined [enabled by default]
panda/src/bullet/bulletBaseCharacterControllerNode.h:47:50: warning: inline function ‘virtual btCharacterControllerInterface* BulletBaseCharacterControllerNode::get_character() const’ used but never defined [enabled by default]
Process exited with exit status 1 and signal code 0
The following command returned a non-zero value: g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/p3bullet_composite.o -Ibuilt/tmp -Ibuilt/include -I/usr/include/python2.7 -I/usr/include/eigen3 -Ithirdparty/linux-libs-x64/bullet/include -DMAKEPANDA= -Ipanda/src/bullet -pthread -msse2 -O2 -DBUILDING_PANDABULLET panda/src/bullet/p3bullet_composite.cxx
Storing dependency cache.
Elapsed Time: 1 min 24 sec
Build process aborting.
Build terminated.

Sorry for the late replay.

I think this is because you are using a Bullet version which is too new. Currently we can support 2.80 (r2531), but not the newest SVN.

The reason for the compile errors is that our class BulletConteactResult implements a callback interface provided by the Bullet lib (class btCollisionWorld::ContactResultCallback), and this interface changed somewhere later than Bullet 2.80 (r2539 from June 6 to be precise). We can not support both interfaces at the same time, so we will be picking up the new one when a new major Bullet release is made and we move to this new major Bullet release.

Suggestion: use Bullet 2.80 and compile again.

aaaah, that makes sense.
thanks!