Odd Linking Error

Post Reply
JeffKr
Posts: 2
Joined: Fri Oct 11, 2013 4:07 pm

Odd Linking Error

Post 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.
c6burns
Posts: 149
Joined: Fri May 24, 2013 6:08 am

Re: Odd Linking Error

Post 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.
JeffKr
Posts: 2
Joined: Fri Oct 11, 2013 4:07 pm

Re: Odd Linking Error

Post 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.
Post Reply