Page 1 of 1

Linux, make fails

Posted: Mon Jul 19, 2021 1:12 pm
by mat
Dear all,
I would like to build and run the Bullet engine on a Ubuntu 18.04 server.

As written in the Git repo: https://github.com/bulletphysics/bullet3
I am executing the following commands:

Code: Select all

./build_cmake_pybullet_double.sh
cd build3
./premake4_linux64 --double gmake
cd gmake
make
During "==== Building Test_BulletCollision (release64) ====" it throws the following error and abords the buil process:

Code: Select all

==== Building Test_BulletCollision (release64) ====
Linking Test_BulletCollision
obj/x64/Release/Test_BulletCollision/main.o: In function `(anonymous namespace)::TriangleCollector::~TriangleCollector()':
main.cpp:(.text+0x38f): undefined reference to `btTriangleCallback::~btTriangleCallback()'
obj/x64/Release/Test_BulletCollision/main.o: In function `(anonymous namespace)::BulletCollisionTest_Heightfield_ProcessAllTriangles_FiltersByUpAxis_Test::TestBody()':
main.cpp:(.text+0xfdce): undefined reference to `btHeightfieldTerrainShape::btHeightfieldTerrainShape(int, int, void const*, double, double, double, int, PHY_ScalarType, bool)'
main.cpp:(.text+0xfe82): undefined reference to `btHeightfieldTerrainShape::processAllTriangles(btTriangleCallback*, btVector3 const&, btVector3 const&) const'
main.cpp:(.text+0xff6e): undefined reference to `btHeightfieldTerrainShape::processAllTriangles(btTriangleCallback*, btVector3 const&, btVector3 const&) const'
main.cpp:(.text+0xffd3): undefined reference to `btTriangleCallback::~btTriangleCallback()'
main.cpp:(.text+0xffea): undefined reference to `btHeightfieldTerrainShape::~btHeightfieldTerrainShape()'
main.cpp:(.text+0x101b1): undefined reference to `btTriangleCallback::~btTriangleCallback()'
main.cpp:(.text+0x101c8): undefined reference to `btHeightfieldTerrainShape::~btHeightfieldTerrainShape()'
obj/x64/Release/Test_BulletCollision/main.o: In function `(anonymous namespace)::TriangleCollector::~TriangleCollector()':
main.cpp:(.text+0x37b): undefined reference to `btTriangleCallback::~btTriangleCallback()'
obj/x64/Release/Test_BulletCollision/main.o:(.data.rel.ro+0xd0): undefined reference to `typeinfo for btTriangleCallback'
collect2: error: ld returned 1 exit status
Test_BulletCollision.make:101: recipe for target '../../bin/Test_BulletCollision_gmake_x64_release' failed
make[1]: *** [../../bin/Test_BulletCollision_gmake_x64_release] Error 1
Makefile:224: recipe for target 'Test_BulletCollision' failed
make: *** [Test_BulletCollision] Error 2
Any ideas what went wrong?

Best regards
mat

Re: Linux, make fails

Posted: Tue Jul 20, 2021 1:18 am
by drleviathan
The first line of your commands should have successfully built the project:

Code: Select all

./build_cmake_pybullet_double.sh
It works for me on Ubuntu-20.04 with cmake-3.20..3, make-4.2.1.

I tried your premake recipe and it failed for the same error. I do not believe the premake config is maintained. My memory tells me that I tried building Bullet with premake about six years ago and was only able to succeed after making changes to the build script. However, I never did submit those changes back to the codebase because they were part of a larger failed experiment.

For best results: use the cmake.