Search code examples
c++windowsinstallationstatic-librariesbulletphysics

Bullet Physics Engine static library installation issues


hey so i just downloaded bullet 2.78, and took the following steps:

  • unziped and found this tutorial

  • followed the steps exactly for Cmake, except i found the pictures in the tutorial had some things checked like INSTALL LIBS and i didn't so I ended up checking EVERYTHING possible.

  • Went into the newly generated BULLET_PHYSICS.vcxproj and built it under debug and release

  • Saw i had a bunch of new libs in the lib folder in msvn/BulletBuild/lib but did nothing with them

  • Followed the rest of the steps in the tutorial exactly for setting up the actual project

  • Tried to build the last line of code: FAIL

  • Wondered Do i NEED the dlls, because only .libs and pdbs showed up in the lib folder, and the tutorial didn't mention em

My only experience in rebuilding libraries is through SFML by building its msvn files included in the download and using the resulting dynamic lib and dll files. The instructions in the tutorial are very different however. (If someone could explain to me how this works it would be GREAT)

I followed the instructions exactly, multiple times but i'm not sure what i'm missing. The build works if i comment out the line of code in main but keep the include, but when i keep it i get this:

    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "void * __cdecl btAlignedAllocInternal(unsigned int,int)" (?btAlignedAllocInternal@@YAPAXIH@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "void __cdecl btAlignedFreeInternal(void *)" (?btAlignedFreeInternal@@YAXPAX@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btConvexInternalShape::getAabbSlow(class btTransform const &,class btVector3 &,class btVector3 &)const " (?getAabbSlow@btConvexInternalShape@@UBEXABVbtTransform@@AAVbtVector3@@1@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall btCollisionShape::serialize(void *,class btSerializer *)const " (?serialize@btCollisionShape@@UBEPBDPAXPAVbtSerializer@@@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: __thiscall btPolyhedralConvexShape::btPolyhedralConvexShape(void)" (??0btPolyhedralConvexShape@@QAE@XZ)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall btPolyhedralConvexShape::~btPolyhedralConvexShape(void)" (??1btPolyhedralConvexShape@@UAE@XZ)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btConvexInternalShape::setLocalScaling(class btVector3 const &)" (?setLocalScaling@btConvexInternalShape@@UAEXABVbtVector3@@@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btCollisionShape::getBoundingSphere(class btVector3 &,float &)const " (?getBoundingSphere@btCollisionShape@@UBEXAAVbtVector3@@AAM@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getAngularMotionDisc(void)const " (?getAngularMotionDisc@btCollisionShape@@UBEMXZ)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getContactBreakingThreshold(float)const " (?getContactBreakingThreshold@btCollisionShape@@UBEMM@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btCollisionShape::serializeSingleShape(class btSerializer *)const " (?serializeSingleShape@btCollisionShape@@UBEXPAVbtSerializer@@@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btBoxShape::getAabb(class btTransform const &,class btVector3 &,class btVector3 &)const " (?getAabb@btBoxShape@@UBEXABVbtTransform@@AAVbtVector3@@1@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btBoxShape::calculateLocalInertia(float,class btVector3 &)const " (?calculateLocalInertia@btBoxShape@@UBEXMAAVbtVector3@@@Z)
    1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall btPolyhedralConvexShape::initializePolyhedralFeatures(void)" (?initializePolyhedralFeatures@btPolyhedralConvexShape@@UAE_NXZ)
    1>C:\Libraries and Headers\Bullet\bullet-2.78\msvc\BulletTestApp\Release\BulletTestApp.exe : fatal error LNK1120: 14 unresolved externals

I know there's a link problem somewhere but i followed the instructions exactly so i don't know how to fix it. I don't see any additional dependencies when looking at the properties of the added projects if that's not how it's supposed to be... but I guess i don't understand this method of using a library in the first place though so that knowledge would help.


Solution

  • Alright, so apparently right clicking my TestBulletApp project and clicking 'Project Dependencies' was where i went wrong. msVS++ 2010 left the option there for some reason even though it
    doesn't work to do it that way.

    Instead to make the project dependent on the other projects in the solution you have to right click on your project like my "TestBulletApp" and go to Properties->Common Properties->Framework and References->Add New Reference" and add the depended on static library projects already added to the sollution such as 'bulletCollision' or whatever; also check that "Link Library Dependencies" is True on the right hand side.

    So yeah thanks for the heads up guys..... 'cough' 'cough' =)