So I've written a few simple C++ programs, gotten GCC to compile them, and then tried to compile the bulletphysics demos... but I'm having trouble.
I'm using the command in terminal:
with some includes (because it's not finding a LOT of the header files)
... but I'm still getting errors
(eg I try to compile BasicDemo.cpp and get the following):
Code: Select all
Undefined symbols for architecture x86_64:
"btAlignedFreeInternal(void*)", referenced from:
BasicDemo::initPhysics() in basicdemo-ef2452.o
BasicDemo::~BasicDemo() in basicdemo-ef2452.o
btTypedConstraint::~btTypedConstraint() in basicdemo-ef2452.o
btAlignedAllocator<btCollisionShape*, 16u>::deallocate(btCollisionShape**) in basicdemo-ef2452.o
btAlignedAllocator<int, 16u>::deallocate(int*) in basicdemo-ef2452.o
btAlignedAllocator<btTriangleInfo, 16u>::deallocate(btTriangleInfo*) in basicdemo-ef2452.o
btAlignedAllocator<btHashInt, 16u>::deallocate(btHashInt*) in basicdemo-ef2452.o
...
"btAlignedAllocInternal(unsigned long, int)", referenced from:
BasicDemo::initPhysics() in basicdemo-ef2452.o
btAlignedAllocator<btCollisionShape*, 16u>::allocate(int, btCollisionShape* const**) in basicdemo-ef2452.o
"btBoxShape::btBoxShape(btVector3 const&)", referenced from:
BasicDemo::initPhysics() in basicdemo-ef2452.o
"btRigidBody::btRigidBody(btRigidBody::btRigidBodyConstructionInfo const&)", referenced from:
BasicDemo::initPhysics() in basicdemo-ef2452.o
"GLDebugDrawer::GLDebugDrawer()", referenced from:
___cxx_global_var_init in basicdemo-ef2452.o
"GLDebugDrawer::~GLDebugDrawer()", referenced from:
___cxx_global_var_init in basicdemo-ef2452.o
"DemoApplication::pickObject(btVector3 const&, btCollisionObject const*)", referenced from:
vtable for BasicDemo in basicdemo-ef2452.o
"DemoApplication::updateCamera()", referenced from:
vtable for BasicDemo in basicdemo-ef2452.o
"DemoApplication::mouseMotionFunc(int, int)", referenced from:
vtable for BasicDemo in basicdemo-ef2452.o
"DemoApplication::keyboardCallback(unsigned char, int, int)", referenced from:
vtable for BasicDemo in basicdemo-ef2452.o
"DemoApplication::setShootBoxShape()", referenced from:
vtable for BasicDemo in basicdemo-ef2452.o
"DemoApplication::setCameraDistance(float)", referenced from:
BasicDemo::initPhysics() in basicdemo-ef2452.o
"DemoApplication::removePickingConstraint()", referenced from:
vtable for BasicDemo in basicdemo-ef2452.o
"DemoApplication::myinit()", referenced from:
vtable for BasicDemo in basicdemo-ef2452.o
"DemoApplication::reshape(int, int)", referenced from:
vtable for BasicDemo in basicdemo-ef2452.o
"DemoApplication::renderme()", referenced from:
vtable for BasicDemo in basicdemo-ef2452.o
"DemoApplication::shootBox(btVector3 const&)", referenced from:
vtable for BasicDemo in basicdemo-ef2452.o
"DemoApplication::mouseFunc(int, int, int, int)", referenced from:
vtable for BasicDemo in basicdemo-ef2452.o
"DemoApplication::~DemoApplication()", referenced from:
GlutDemoApplication::~GlutDemoApplication() in basicdemo-ef2452.o
"btDbvtBroadphase::btDbvtBroadphase(btOverlappingPairCache*)", referenced from:
BasicDemo::initPhysics() in basicdemo-ef2452.o
"GlutDemoApplication::swapBuffers()", referenced from:
vtable for BasicDemo in basicdemo-ef2452.o
"GlutDemoApplication::specialKeyboard(int, int, int)", referenced from:
vtable for BasicDemo in basicdemo-ef2452.o
"GlutDemoApplication::updateModifierKeys()", referenced from:
vtable for BasicDemo in basicdemo-ef2452.o
"btCollisionDispatcher::btCollisionDispatcher(btCollisionConfiguration*)", referenced from:
BasicDemo::initPhysics() in basicdemo-ef2452.o
"btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(btDispatcher*, btBroadphaseInterface*, btConstraintSolver*, btCollisionConfiguration*)", referenced from:
BasicDemo::initPhysics() in basicdemo-ef2452.o
"btDefaultCollisionConfiguration::btDefaultCollisionConfiguration(btDefaultCollisionConstructionInfo const&)", referenced from:
BasicDemo::initPhysics() in basicdemo-ef2452.o
"btSequentialImpulseConstraintSolver::btSequentialImpulseConstraintSolver()", referenced from:
BasicDemo::initPhysics() in basicdemo-ef2452.o
"btClock::getTimeMicroseconds()", referenced from:
DemoApplication::getDeltaTimeMicroseconds() in basicdemo-ef2452.o
"btClock::reset()", referenced from:
DemoApplication::getDeltaTimeMicroseconds() in basicdemo-ef2452.o
"btTypedConstraint::serialize(void*, btSerializer*) const", referenced from:
vtable for btTypedConstraint in basicdemo-ef2452.o
"typeinfo for GlutDemoApplication", referenced from:
typeinfo for BasicDemo in basicdemo-ef2452.o
"_glClear", referenced from:
BasicDemo::clientMoveAndDisplay() in basicdemo-ef2452.o
BasicDemo::displayCallback() in basicdemo-ef2452.o
"_glFlush", referenced from:
BasicDemo::clientMoveAndDisplay() in basicdemo-ef2452.o
BasicDemo::displayCallback() in basicdemo-ef2452.o
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What am I doing wrong/ what is going on?
Thanks!