how to incorporate the libraries?

rodrigoml
Posts: 5
Joined: Fri Jan 21, 2011 12:58 am
Location: argentina

how to incorporate the libraries?

Post by rodrigoml »

hello, I m interested in intro to physics simulation, with the characteristic bullet libraries specially, on linux, but it is my first problem:

I done the installation procedure.. cmake, configure, make, make install (in this step, it copied the folders tree with .h libraries, "/usr/local/include/bullet").. but I cant compile my codes because gcc dont recognizes the bullet libraries! so, for example, any functional code with #include<btBulletDynamicsCommon.h> becomes non-functional (error to compile).

I appreciate any help for me. thanks for his works, i hope contribute.
lulzfish
Posts: 43
Joined: Mon Jan 03, 2011 4:26 pm

Re: how to incorporate the libraries?

Post by lulzfish »

Can you copy the error here? It might be easier for us to help if you do.
rodrigoml
Posts: 5
Joined: Fri Jan 21, 2011 12:58 am
Location: argentina

Re: how to incorporate the libraries?

Post by rodrigoml »

lulzfish wrote:Can you copy the error here? It might be easier for us to help if you do.
yes, here

little code, test.cpp:
#include <btBulletDynamicsCommon.h>
int main()
{
return 0;
}

compile:
rodri@dora:~/Escritorio/temporal$ gcc test.cpp -lBulletDynamics
test.cpp:1:36: error: btBulletDynamicsCommon.h: No existe el fichero ó directorio

(file does not exist)
lulzfish
Posts: 43
Joined: Mon Jan 03, 2011 4:26 pm

Re: how to incorporate the libraries?

Post by lulzfish »

I see, it's not even finding the headers.
In my code, I have:

Code: Select all

#include <bullet/btBulletDynamicsCommon.h>
Because all the Bullet headers are within the /usr/include/bullet directory, and normally GCC will just check /usr/include.
rodrigoml
Posts: 5
Joined: Fri Jan 21, 2011 12:58 am
Location: argentina

Re: how to incorporate the libraries?

Post by rodrigoml »

U thanks, I can compile now!!

#include <bullet/btBulletDynamicsCommon.h> --->

rodri@dora:~/Escritorio/temporal$ gcc test.cpp -lBulletDynamics
In file included from /usr/local/include/bullet/btBulletCollisionCommon.h:22,
from /usr/local/include/bullet/btBulletDynamicsCommon.h:20,
from test.cpp:1:
/usr/local/include/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.h:74:34: error: LinearMath/btVector3.h: No existe el fichero ó directorio
/usr/local/include/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.h:75:36: error: LinearMath/btTransform.h: No existe el fichero ó directorio
In file included from /usr/local/include/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.h:76,
from /usr/local/include/bullet/btBulletCollisionCommon.h:22,
from /usr/local/include/bullet/btBulletDynamicsCommon.h:20,
from test.cpp:1:
/usr/local/include/bullet/BulletCollision/CollisionDispatch/btCollisionObject.h:31:38: error: LinearMath/btMotionState.h: No existe el fichero ó directorio
/usr/local/include/bullet/BulletCollision/CollisionDispatch/btCollisionObject.h:32:43: error: LinearMath/btAlignedAllocator.h: No existe el fichero ó directorio
/usr/local/include/bullet/BulletCollision/CollisionDispatch/btCollisionObject.h:33:45: error: LinearMath/btAlignedObjectArray.h: No existe el fichero ó directorio
...........


so I directlly changed the bullet directory to the folder up, and use #include <btBulletDynamicsCommon.h>, and so compile without errors..

thank you very much.
I'm programming right now!
rodrigoml
Posts: 5
Joined: Fri Jan 21, 2011 12:58 am
Location: argentina

Re: how to incorporate the libraries?

Post by rodrigoml »

hello again, new problems:

it can compile, but the binary does not work

rodri@dora:~$ '/home/rodri/Escritorio/temporal/test'
/home/rodri/Escritorio/temporal/test: error while loading shared libraries: libBulletDynamics.so.2.77: cannot open shared object file: No such file or directory

I look for these libBulletDynamics.so.2.77 in the linux file system, but was not, I dont know, bad make intstall may be. Then I try coping the .so files generating for the make, in the libs folders into the linux file system, not work..

sorry for the delay, connection problem.
User avatar
ejtttje
Posts: 96
Joined: Mon Nov 03, 2008 9:57 pm

Re: how to incorporate the libraries?

Post by ejtttje »

If you run 'ldd' on your executable, it will list the path where it expects to find each library it is attempting to load.