Page 1 of 1

Odd Linking Error

Posted: Fri Oct 11, 2013 4:25 pm
by JeffKr
Hi,
I'm new to Bullet, ran through the demo programs got them compiling/running just fine, started to add the Bullet HelloWorld demo to an existing VS2008 project and ran into a couple errors.

It compiles nice and happy with

Code: Select all

btDefaultCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration();
btCollisionDispatcher* dispatcher = new btCollisionDispatcher(collisionConfiguration);
btBroadphaseInterface* overlappingPairCache = new btDbvtBroadphase();
but as soon as I add

Code: Select all

btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver;
It gives me these errors.

Creating library ..\..\Final\Lib\Main.dll.lib and object ..\..\Final\Lib\Main.dll.exp
Main.obj : error LNK2019: unresolved external symbol "void * __fastcall btAlignedAllocInternal(unsigned int,int)" (?btAlignedAllocInternal@@YIPAXIH@Z) referenced in function "public: static void * __fastcall btSequentialImpulseConstraintSolver::operator new(unsigned int)" (??2btSequentialImpulseConstraintSolver@@SIPAXI@Z)

Main.obj : error LNK2019: unresolved external symbol "void __fastcall btAlignedFreeInternal(void *)" (?btAlignedFreeInternal@@YIXPAX@Z) referenced in function "public: static void __fastcall btSequentialImpulseConstraintSolver::operator delete(void *)" (??3btSequentialImpulseConstraintSolver@@SIXPAX@Z)
..\..\Final\Bin/Main.dll : fatal error LNK1120: 2 unresolved externals

Any help would be greatly appreciated.

Re: Odd Linking Error

Posted: Mon Oct 14, 2013 4:55 am
by c6burns
The first three are in the collision library, while the one giving you link errors is in the dynamics library. You are linking against BulletDynamics, yes? I assume you'd have more link errors if you weren't but that's all I could think.

Re: Odd Linking Error

Posted: Mon Oct 14, 2013 1:52 pm
by JeffKr
Yep, I was linking against BulletDynamics.

Turns out it was a calling convention problem. __cdecl vs __fastcall
It wasn't happy with mixing them.