Trying to build libraries, link error?

senorandres64
Posts: 1
Joined: Wed Aug 10, 2011 2:03 am

Trying to build libraries, link error?

Post by senorandres64 »

I don't have much experience installing libraries with unix so I trying to follow the step on the installation wiki site. I got the install package, and extracted it into my home dir. then ran:

cd bullet-2.78
mkdir bullet-build
cd bullet-build
cmake .. -G "Unix Makefiles" -DINSTALL_LIBS=ON -DBUILD_SHARED_LIBS=ON

here i get some warnings involving OPENGL?:
ALL_LIBS=ON -DBUILD_SHARED_LIBS=ON
OPENCL NOT FOUND
OPENGL FOUND
/usr/lib/libGLU.so/usr/lib/libGL.so/usr/lib/libSM.so/usr/lib/libICE.so/usr/lib/libX11.so/usr/lib/libXext.so
-- WARNING: you are using the obsolete 'GLU' package, please use 'OpenGL' instead
GLUT FOUND
/usr/lib/libglut.so
-- WARNING: you are using the obsolete 'GLU' package, please use 'OpenGL' instead
-- Configuring done
-- Generating done
-- Build files have been written to: /home/prestinary/bullet-2.78

then i ran these:
make -j4
sudo make install

but the second command ends with:
collect2: ld returned 1 exit status
make[2]: *** [Demos/OpenCLClothDemo/MiniCL/AppOpenCLClothDemo_Mini] Error 1
make[1]: *** [Demos/OpenCLClothDemo/MiniCL/CMakeFiles/AppOpenCLClothDemo_Mini.dir/all] Error 2
make: *** [all] Error 2


then i tried making this program to see if it worked:
http://www.bulletphysics.org/mediawiki- ... ello_World
tried compiling with g++ -I/usr/local/include/bullet but i get an error that i'm pretty sure has to do with linking????

phys1.c:3: fatal error: btBulletDynamicsCommon.h: No such file or directory
compilation terminated.
prestinary@Fermi:~$ g++ phys1.c -I/usr/local/include/bullet
/tmp/ccOYvRBa.o: In function `main':
phys1.c:(.text+0x2b): undefined reference to `btDbvtBroadphase::btDbvtBroadphase(btOverlappingPairCache*)'
phys1.c:(.text+0x80): undefined reference to `btDefaultCollisionConfiguration::btDefaultCollisionConfiguration(btDefaultCollisionConstructionInfo const&)'
phys1.c:(.text+0xc4): undefined reference to `btCollisionDispatcher::btCollisionDispatcher(btCollisionConfiguration*)'
phys1.c:(.text+0xfd): undefined reference to `btSequentialImpulseConstraintSolver::btSequentialImpulseConstraintSolver()'
phys1.c:(.text+0x162): undefined reference to `btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(btDispatcher*, btBroadphaseInterface*, btConstraintSolver*, btCollisionConfiguration*)'
phys1.c:(.text+0x27c): undefined reference to `btStaticPlaneShape::btStaticPlaneShape(btVector3 const&, float)'
phys1.c:(.text+0x4ac): undefined reference to `btRigidBody::btRigidBody(btRigidBody::btRigidBodyConstructionInfo const&)'
phys1.c:(.text+0x6f3): undefined reference to `btRigidBody::btRigidBody(btRigidBody::btRigidBodyConstructionInfo const&)'
/tmp/ccOYvRBa.o: In function `btCollisionObject::operator new(unsigned int)':
phys1.c:(.text._ZN17btCollisionObjectnwEj[btCollisionObject::operator new(unsigned int)]+0x15): undefined reference to `btAlignedAllocInternal(unsigned int, int)'
/tmp/ccOYvRBa.o: In function `btCollisionObject::operator delete(void*)':
phys1.c:(.text._ZN17btCollisionObjectdlEPv[btCollisionObject::operator delete(void*)]+0xd): undefined reference to `btAlignedFreeInternal(void*)'
/tmp/ccOYvRBa.o: In function `btConvexShape::operator delete(void*)':
phys1.c:(.text._ZN13btConvexShapedlEPv[btConvexShape::operator delete(void*)]+0xd): undefined reference to `btAlignedFreeInternal(void*)'
/tmp/ccOYvRBa.o: In function `btConvexInternalShape::~btConvexInternalShape()':
phys1.c:(.text._ZN21btConvexInternalShapeD2Ev[btConvexInternalShape::~btConvexInternalShape()]+0xb): undefined reference to `vtable for btConvexInternalShape'
phys1.c:(.text._ZN21btConvexInternalShapeD2Ev[btConvexInternalShape::~btConvexInternalShape()]+0x16): undefined reference to `btConvexShape::~btConvexShape()'
/tmp/ccOYvRBa.o: In function `btSphereShape::operator new(unsigned int)':
phys1.c:(.text._ZN13btSphereShapenwEj[btSphereShape::operator new(unsigned int)]+0x15): undefined reference to `btAlignedAllocInternal(unsigned int, int)'
/tmp/ccOYvRBa.o: In function `btSphereShape::operator delete(void*)':
phys1.c:(.text._ZN13btSphereShapedlEPv[btSphereShape::operator delete(void*)]+0xd): undefined reference to `btAlignedFreeInternal(void*)'
/tmp/ccOYvRBa.o: In function `btSphereShape::btSphereShape(float)':
phys1.c:(.text._ZN13btSphereShapeC1Ef[btSphereShape::btSphereShape(float)]+0xd): undefined reference to `btConvexInternalShape::btConvexInternalShape()'
phys1.c:(.text._ZN13btSphereShapeC1Ef[btSphereShape::btSphereShape(float)]+0x16): undefined reference to `vtable for btSphereShape'
/tmp/ccOYvRBa.o: In function `btAlignedAllocator<int, 16u>::deallocate(int*)':
phys1.c:(.text._ZN18btAlignedAllocatorIiLj16EE10deallocateEPi[btAlignedAllocator<int, 16u>::deallocate(int*)]+0xd): undefined reference to `btAlignedFreeInternal(void*)'
/tmp/ccOYvRBa.o: In function `btAlignedAllocator<btHashInt, 16u>::deallocate(btHashInt*)':
phys1.c:(.text._ZN18btAlignedAllocatorI9btHashIntLj16EE10deallocateEPS0_[btAlignedAllocator<btHashInt, 16u>::deallocate(btHashInt*)]+0xd): undefined reference to `btAlignedFreeInternal(void*)'
/tmp/ccOYvRBa.o: In function `btAlignedAllocator<btTriangleInfo, 16u>::deallocate(btTriangleInfo*)':
phys1.c:(.text._ZN18btAlignedAllocatorI14btTriangleInfoLj16EE10deallocateEPS0_[btAlignedAllocator<btTriangleInfo, 16u>::deallocate(btTriangleInfo*)]+0xd): undefined reference to `btAlignedFreeInternal(void*)'
/tmp/ccOYvRBa.o:(.rodata._ZTV17btTypedConstraint[vtable for btTypedConstraint]+0x30): undefined reference to `btTypedConstraint::serialize(void*, btSerializer*) const'
collect2: ld returned 1 exit status

thanks in advance, i have the feeling this is pretty simple but I just don't have any experience compiling libraries
ouch67
Posts: 17
Joined: Tue Jul 26, 2011 9:24 pm

Re: Trying to build libraries, link error?

Post by ouch67 »

most likely you just have the libraries out of order.

link collision first, dynamics second.