Problem linking libraries helloworld Win7 64 bits

Mataco
Posts: 2
Joined: Fri Mar 02, 2012 9:15 pm

Problem linking libraries helloworld Win7 64 bits

Post by Mataco »

I'm using eclipse to build a bulletphysics helloworld program but I keep getting these linking errors:

Code: Select all

g++ -IC:\bullet\src -O0 -g3 -Wall -c -fmessage-length=0 -o main.o ..\main.cpp
g++ -LC:\testbp -o bullet.exe main.o -lglu32 -lgdi32 -lopengl32 -lfreeglut -lwinmm -lBulletDynamics -lBulletCollision -lLinearMath
main.o: In function `Z11initPhysicsv':
C:\Users\Matias\workspace\bullet\Debug/../main.cpp:339: undefined reference to `btDbvtBroadphase::btDbvtBroadphase(btOverlappingPairCache*)'
C:\Users\Matias\workspace\bullet\Debug/../main.cpp:341: undefined reference to `btDefaultCollisionConfiguration::btDefaultCollisionConfiguration(btDefaultCollisionConstructionInfo const&)'
C:\Users\Matias\workspace\bullet\Debug/../main.cpp:342: undefined reference to `btCollisionDispatcher::btCollisionDispatcher(btCollisionConfiguration*)'
C:\Users\Matias\workspace\bullet\Debug/../main.cpp:344: undefined reference to `btSequentialImpulseConstraintSolver::btSequentialImpulseConstraintSolver()'
C:\Users\Matias\workspace\bullet\Debug/../main.cpp:346: undefined reference to `btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(btDispatcher*, btBroadphaseInterface*, btConstraintSolver*, btCollisionConfiguration*)'
C:\Users\Matias\workspace\bullet\Debug/../main.cpp:351: undefined reference to `btStaticPlaneShape::btStaticPlaneShape(btVector3 const&, float)'
C:\Users\Matias\workspace\bullet\Debug/../main.cpp:358: undefined reference to `btRigidBody::btRigidBody(btRigidBody::btRigidBodyConstructionInfo const&)'
C:\Users\Matias\workspace\bullet\Debug/../main.cpp:364: undefined reference to `btBoxShape::btBoxShape(btVector3 const&)'
C:\Users\Matias\workspace\bullet\Debug/../main.cpp:394: undefined reference to `btRigidBody::btRigidBody(btRigidBody::btRigidBodyConstructionInfo const&)'
C:\Users\Matias\workspace\bullet\Debug/../main.cpp:414: undefined reference to `btRigidBody::btRigidBody(btRigidBody::btRigidBodyConstructionInfo const&)'
C:\Users\Matias\workspace\bullet\Debug/../main.cpp:418: undefined reference to `btCollisionObject::setActivationState(int)'
C:\Users\Matias\workspace\bullet\Debug/../main.cpp:425: undefined reference to `btBoxShape::btBoxShape(btVector3 const&)'
C:\Users\Matias\workspace\bullet\Debug/../main.cpp:435: undefined reference to `btRigidBody::btRigidBody(btRigidBody::btRigidBodyConstructionInfo const&)'
main.o: In function `ZN17btCollisionObjectnwEj':
C:/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.h:115: undefined reference to `btAlignedAllocInternal(unsigned int, int)'
main.o: In function `ZN17btCollisionObjectdlEPv':
C:/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.h:115: undefined reference to `btAlignedFreeInternal(void*)'
main.o: In function `ZN13btConvexShapenwEj':
C:/bullet/src/BulletCollision/CollisionShapes/btConvexShape.h:37: undefined reference to `btAlignedAllocInternal(unsigned int, int)'
main.o: In function `ZN13btConvexShapedlEPv':
C:/bullet/src/BulletCollision/CollisionShapes/btConvexShape.h:37: undefined reference to `btAlignedFreeInternal(void*)'
main.o: In function `ZN13btSphereShapenwEj':
C:/bullet/src/BulletCollision/CollisionShapes/btSphereShape.h:27: undefined reference to `btAlignedAllocInternal(unsigned int, int)'
main.o: In function `ZN13btSphereShapedlEPv':
C:/bullet/src/BulletCollision/CollisionShapes/btSphereShape.h:27: undefined reference to `btAlignedFreeInternal(void*)'
main.o: In function `btSphereShape':
C:/bullet/src/BulletCollision/CollisionShapes/btSphereShape.h:29: undefined reference to `btConvexInternalShape::btConvexInternalShape()'
C:/bullet/src/BulletCollision/CollisionShapes/btSphereShape.h:29: undefined reference to `vtable for btSphereShape'
main.o: In function `ZN18btAlignedAllocatorIiLj16EE10deallocateEPi':
C:/bullet/src/LinearMath/btAlignedAllocator.h:90: undefined reference to `btAlignedFreeInternal(void*)'
main.o: In function `ZN18btAlignedAllocatorI9btHashIntLj16EE10deallocateEPS0_':
C:/bullet/src/LinearMath/btAlignedAllocator.h:90: undefined reference to `btAlignedFreeInternal(void*)'
main.o: In function `ZN18btAlignedAllocatorI14btTriangleInfoLj16EE10deallocateEPS0_':
C:/bullet/src/LinearMath/btAlignedAllocator.h:90: undefined reference to `btAlignedFreeInternal(void*)'
main.o:main.cpp:(.rdata$_ZTV17btTypedConstraint[vtable for btTypedConstraint]+0x30): undefined reference to `btTypedConstraint::serialize(void*, btSerializer*) const'
The IDE used is Eclipse CDT on a Windows 7 64 bits.

From other threads I read before posting this many times the solution was the order of linking the libs, but I'm doing it in the correct order and keep getting the same result.
I tried generating the libraries in different ways. Once using VisualStudio which gave me the *.lib files and then I tried generating with minGW on a Linux distribution in the same machine, getting the *.a files. Both cases gave me the same linking errors.

Looking forward to a reply.
Thanks for your time.
Mataco
Posts: 2
Joined: Fri Mar 02, 2012 9:15 pm

Re: Problem linking libraries helloworld Win7 64 bits

Post by Mataco »

Well, nevermind, just generated the libraries with codeblocks and worked. 8)