makepanda fails with bullet 2.81

I tried to compile panda3d using makepanda on Linux Mint Debian with the following command:

makepanda/makepanda.py --installer --nothing --use-python --use-zlib --use-png --use-openal --use-pandatool --use-direct --use-gl --use-bullet --use-x11 --threads 2

I need bullet and because i didn’t find it as a DEB i downloaded the version 2.81 from bulletphysics.com. Makepanda doesn’t give a warning about not finding something so it should find bullet. It’s installed in /usr/local/lib. See:

$ ls /usr/local/lib
libBulletCollision.so       libBulletSoftBody.so       pkgconfig  site_ruby
libBulletCollision.so.2.81  libBulletSoftBody.so.2.81  python2.6
libBulletDynamics.so        libLinearMath.so           python2.7
libBulletDynamics.so.2.81   libLinearMath.so.2.81      python3.2

But i get the following error which seems to be related to bullet:

[T2] Building Interrogate database built/pandac/input/libpandabullet.in
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:132:23: error: invalid abstract return type for member function ‘BulletContactResult BulletWorld::contact_test(PandaNode*) const’
In file included from panda/src/bullet/bulletWorld.h:26:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
panda/src/bullet/bulletContactResult.h:56:26: note:   because the following virtual functions are pure within ‘BulletContactResult’:
In file included from /usr/local/include/bullet/btBulletCollisionCommon.h:22:0,
                 from /usr/local/include/bullet/btBulletDynamicsCommon.h:20,
                 from panda/src/bullet/bullet_includes.h:20,
                 from panda/src/bullet/bulletWorld.h:20,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
/usr/local/include/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.h:429:20: note: 	virtual btScalar btCollisionWorld::ContactResultCallback::addSingleResult(btManifoldPoint&, const btCollisionObjectWrapper*, int, int, const btCollisionObjectWrapper*, int, int)
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:133:23: error: invalid abstract return type for member function ‘BulletContactResult BulletWorld::contact_test_pair(PandaNode*, PandaNode*) const’
In file included from panda/src/bullet/bulletWorld.h:26:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
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:656:21: error: invalid abstract return type for member function ‘BulletContactResult BulletWorld::contact_test(PandaNode*) const’
In file included from panda/src/bullet/bulletWorld.h:26:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
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:42:0:
panda/src/bullet/bulletWorld.cxx:661:23: error: cannot declare variable ‘cb’ to be of abstract type ‘BulletContactResult’
In file included from panda/src/bullet/bulletWorld.h:26:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
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:42:0:
panda/src/bullet/bulletWorld.cxx:667:10: error: cannot allocate an object of abstract type ‘BulletContactResult’
In file included from panda/src/bullet/bulletWorld.h:26:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
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:42:0:
panda/src/bullet/bulletWorld.cxx: In member function ‘BulletContactResult BulletWorld::contact_test_pair(PandaNode*, PandaNode*) const’:
panda/src/bullet/bulletWorld.cxx:675:21: error: invalid abstract return type for member function ‘BulletContactResult BulletWorld::contact_test_pair(PandaNode*, PandaNode*) const’
In file included from panda/src/bullet/bulletWorld.h:26:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
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:42:0:
panda/src/bullet/bulletWorld.cxx:681:23: error: cannot declare variable ‘cb’ to be of abstract type ‘BulletContactResult’
In file included from panda/src/bullet/bulletWorld.h:26:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
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:42:0:
panda/src/bullet/bulletWorld.cxx:687:10: error: cannot allocate an object of abstract type ‘BulletContactResult’
In file included from panda/src/bullet/bulletWorld.h:26:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
panda/src/bullet/bulletContactResult.h:56:26: note:   since type ‘BulletContactResult’ has pure virtual functions
In file included from panda/src/bullet/bulletWorld.h:28:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
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]
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/local/include/bullet -DMAKEPANDA= -Ipanda/src/bullet -pthread -O2 -DBUILDING_PANDABULLET panda/src/bullet/p3bullet_composite.cxx
Storing dependency cache.
Elapsed Time: 4 sec
Build process aborting.
Build terminated.

Since i’m not really into C/C++ i can’t say for sure what this error means. It seems related to bullet. Can anyone tell me what’s wrong?

Which version of the Panda3D source code did you try to compile? A release version, or current CVS HEAD (with date please)?

Sorry that i forgot to write that.
I’m building version 1.8.1.

This is the current release branch. You need to use Bullet 2.80, because of API changes between Bullet 2.80 and 2.81 which would lead to API changed in the Pand3D Bullet API. Since Panda3D enforces ABI compatibility on major releases (1.8.x), we can’t do these modification on the release branch:

  • Bullet 2.81 has been released Oct 2012
  • Panda3D 1.8.0 has been released Feb 2012 (older!)

So either use Panda3D 1.8.1 (release) and Bullet 2.80, or current Panda3D snapshot and Bullet 2.81.

For more details please see: Panda Bullet

I now installed bullet 2.80-rev2531 and tried to build panda3d 1.8.1.
I also removed the --use-zlib from the command line to enforce a new build.
I now get this error:

[T1] Building C++ object built/tmp/p3bullet_composite.o
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:132:23: error: invalid abstract return type for member function ‘BulletContactResult BulletWorld::contact_test(PandaNode*) const’
In file included from panda/src/bullet/bulletWorld.h:26:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
panda/src/bullet/bulletContactResult.h:56:26: note:   because the following virtual functions are pure within ‘BulletContactResult’:
In file included from /usr/local/include/bullet/btBulletCollisionCommon.h:22:0,
                 from /usr/local/include/bullet/btBulletDynamicsCommon.h:20,
                 from panda/src/bullet/bullet_includes.h:20,
                 from panda/src/bullet/bulletWorld.h:20,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
/usr/local/include/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.h:429:20: note: 	virtual btScalar btCollisionWorld::ContactResultCallback::addSingleResult(btManifoldPoint&, const btCollisionObjectWrapper*, int, int, const btCollisionObjectWrapper*, int, int)
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:133:23: error: invalid abstract return type for member function ‘BulletContactResult BulletWorld::contact_test_pair(PandaNode*, PandaNode*) const’
In file included from panda/src/bullet/bulletWorld.h:26:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
panda/src/bullet/bulletContactResult.h:56:26: note:   since type ‘BulletContactResult’ has pure virtual functions


[T2] Linking dynamic library built/lib/libpandagl.so
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:656:21: error: invalid abstract return type for member function ‘BulletContactResult BulletWorld::contact_test(PandaNode*) const’
In file included from panda/src/bullet/bulletWorld.h:26:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
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:42:0:
panda/src/bullet/bulletWorld.cxx:661:23: error: cannot declare variable ‘cb’ to be of abstract type ‘BulletContactResult’
In file included from panda/src/bullet/bulletWorld.h:26:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
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:42:0:
panda/src/bullet/bulletWorld.cxx:667:10: error: cannot allocate an object of abstract type ‘BulletContactResult’
In file included from panda/src/bullet/bulletWorld.h:26:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
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:42:0:
panda/src/bullet/bulletWorld.cxx: In member function ‘BulletContactResult BulletWorld::contact_test_pair(PandaNode*, PandaNode*) const’:
panda/src/bullet/bulletWorld.cxx:675:21: error: invalid abstract return type for member function ‘BulletContactResult BulletWorld::contact_test_pair(PandaNode*, PandaNode*) const’
In file included from panda/src/bullet/bulletWorld.h:26:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
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:42:0:
panda/src/bullet/bulletWorld.cxx:681:23: error: cannot declare variable ‘cb’ to be of abstract type ‘BulletContactResult’
In file included from panda/src/bullet/bulletWorld.h:26:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
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:42:0:
panda/src/bullet/bulletWorld.cxx:687:10: error: cannot allocate an object of abstract type ‘BulletContactResult’
In file included from panda/src/bullet/bulletWorld.h:26:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
panda/src/bullet/bulletContactResult.h:56:26: note:   since type ‘BulletContactResult’ has pure virtual functions


[T2] Building Interrogate database built/pandac/input/libpandabullet.in
In file included from panda/src/bullet/bulletWorld.h:28:0,
                 from panda/src/bullet/config_bullet.h:27,
                 from panda/src/bullet/config_bullet.cxx:15,
                 from panda/src/bullet/p3bullet_composite.cxx:1:
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]
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/local/include/bullet -DMAKEPANDA= -Ipanda/src/bullet -pthread -O2 -DBUILDING_PANDABULLET panda/src/bullet/p3bullet_composite.cxx
Storing dependency cache.
Elapsed Time: 10 min 13 sec
Build process aborting.
Build terminated.
/btCollisionWorld.h:429:20: note:    virtual btScalar btCollisionWorld::ContactResultCallback::addSingleResult(btManifoldPoint&, const btCollisionObjectWrapper*, int, int, const btCollisionObjectWrapper*, int, int)

I still see the Bullet 2.81 signatur for the contact result callback. In Bullet 2.80 there has been no “btCollisionObjectWrapper”, and the argument have not been “const”.

Either you failed at replacing Bullet-2.81 with 2.80 (and you still have 2.81 somewhere around), or you did not clean up the Panda3D built directory.

I don’t know about Linux, but on Windows it is NOT enough to simply modify you build parameters - you have to delete the “built” directory and do a new, clean build.

Sorry for the last post. A few minutes after posting i realised that i forgot to install bullet after compiling. But i hadn’t time to edit the post. I finished the build right now. Thanks for your help.

You’re welcome. If you intend to use Bullet I would recommend using Panda3D CVS & Bullet 2.81. There have been many improvements and bugfixes, both in Bullet 2.80 to 2.81 and in Panda3D’s Bullet module since the 1.8.0 release. And the Panda3D CVS can be assumed to be nearly as stable as the release versions.

Thanks. I will consider you suggestion. Using the CVS version might be a good idea.