user1519665
user1519665

Reputation: 511

Fresh installation of bullet physics engine is not linking properly?

Have a relatively new and fresh installation of ubuntu LTS, I followed the instructions found here for generic dynamic library building: http://www.bulletphysics.org/mediawiki-1.5.8/index.php/Installation

Installation appears to go smoothly (no errors or warnings) and afterwards I have all of the necessary files located in /usr/local/include/bullet. I'm currently attempting to compile a file from the following shell command:

g++ bulletTest.cpp -lGL -lGLU -I /usr/local/include/bullet/

bulletTest.cpp is:

#include <iostream>
#include <btBulletDynamicsCommon.h>
int main (void)
{
    btBroadphaseInterface* broadphase;
    return 0;
}

This file has nothing to it, but is throwing a plethora of undefined reference errors, such as "/tmp/ccH09wLR.o:(.rodata._ZTV17btTypedConstraint[_ZTV17btTypedConstraint]+0x30): undefined reference to `__cxa_pure_virtual'" I cannot find any other complaints on the forums/SO so I believe it must be a problem with my build/installation. These types of errors occur while attempting both gcc and g++ compilers.

Anybody have an idea?

EDIT: changed my shell command to g++ bulletTest.cpp -lGL -lGLU -lBulletDynamics -lBulletCollision -lBulletSoftBody -lLinearMath -I /usr/local/include/bullet/

It compiles but does not run, error is: error while loading shared libraries: libBulletDynamics.so.2.82: cannot open shared object file: No such file or directory

Upvotes: 0

Views: 1210

Answers (1)

user1519665
user1519665

Reputation: 511

So it was a lot of little stuff. Firstly, don't reference "lbullet" reference each of the libraries needed:

g++ bulletTest.cpp -o bulletTest -lGL -lGLU -lBulletDynamics -lBulletCollision -lBulletSoftBody -lLinearMath -I /usr/local/include/bullet/

In addition, I had to set the LD_LIBRARY_PATH variable

export LD_LIBRARY_PATH=/usr/local/lib

and then it would both compile and run.

Upvotes: 2

Related Questions