Unresolved external symbols

Post Reply
Magmatwister
Posts: 5
Joined: Sat Sep 11, 2010 10:25 pm

Unresolved external symbols

Post by Magmatwister »

I've been working on a directx9 c++ game which hasn't been getting very far until recently and I decided yesterday to try integrating the Bullet physics engine. Unfortunately, even though I followed the wiki tutorial on how to set it up to the letter, I get all these errors: :roll:

4>------ Build started: Project: BulletPoint, Configuration: Release Win32 ------
4>BulletPoint.obj : error LNK2001: unresolved external symbol "void * __cdecl btAlignedAllocInternal(unsigned int,int)" (?btAlignedAllocInternal@@YAPAXIH@Z)
4>BulletPoint.obj : error LNK2001: unresolved external symbol "void __cdecl btAlignedFreeInternal(void *)" (?btAlignedFreeInternal@@YAXPAX@Z)
4>BulletPoint.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall btConvexShape::~btConvexShape(void)" (??1btConvexShape@@UAE@XZ)
4>BulletPoint.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)
4>BulletPoint.obj : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall btCollisionShape::serialize(void *,class btSerializer *)const " (?serialize@btCollisionShape@@UBEPBDPAXPAVbtSerializer@@@Z)
4>BulletPoint.obj : error LNK2001: unresolved external symbol "public: __thiscall btPolyhedralConvexShape::btPolyhedralConvexShape(void)" (??0btPolyhedralConvexShape@@QAE@XZ)
4>BulletPoint.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btConvexInternalShape::setLocalScaling(class btVector3 const &)" (?setLocalScaling@btConvexInternalShape@@UAEXABVbtVector3@@@Z)
4>BulletPoint.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btCollisionShape::getBoundingSphere(class btVector3 &,float &)const " (?getBoundingSphere@btCollisionShape@@UBEXAAVbtVector3@@AAM@Z)
4>BulletPoint.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getAngularMotionDisc(void)const " (?getAngularMotionDisc@btCollisionShape@@UBEMXZ)
4>BulletPoint.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getContactBreakingThreshold(float)const " (?getContactBreakingThreshold@btCollisionShape@@UBEMM@Z)
4>BulletPoint.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btCollisionShape::serializeSingleShape(class btSerializer *)const " (?serializeSingleShape@btCollisionShape@@UBEXPAVbtSerializer@@@Z)
4>BulletPoint.obj : error LNK2001: unresolved external symbol "public: virtual class btVector3 __thiscall btConvexInternalShape::localGetSupportingVertex(class btVector3 const &)const " (?localGetSupportingVertex@btConvexInternalShape@@UBE?AVbtVector3@@ABV2@@Z)
4>BulletPoint.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)
4>BulletPoint.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btBoxShape::calculateLocalInertia(float,class btVector3 &)const " (?calculateLocalInertia@btBoxShape@@UBEXMAAVbtVector3@@@Z)

Can anyone help me? I really did try and do every step and even searched a few threads to see if i could fix it =/
Magmatwister
Posts: 5
Joined: Sat Sep 11, 2010 10:25 pm

Re: Unresolved external symbols

Post by Magmatwister »

Can someone please help me, I've made multiple projects and repeated each step specificed in the wikipedia as well as those I found through searching threads. I really have done all that I can. I really want to get started in physics! :O :cry:
jeti
Posts: 6
Joined: Tue Sep 07, 2010 10:35 pm

Re: Unresolved external symbols

Post by jeti »

Hi,
I'm new to bullet, too, and I'm working under linux so I can't give you the exact solution.
What you have is a linker error and points out that the bullet libraries are not linked in...
I'm assuming you use Visual C++, so this might be a starting point to see how to link libraries: http://msdn.microsoft.com/en-us/library ... 80%29.aspx
Another thing is, in bullet's lib folder is only a readme saying that there is nothing yet. Thant meant for me that I needed to add all the directories within the built src-folder and the libraries in them.

I'm not sure if this is helpful information for you as I don't know what you know from the wiki and threads.
If you need further help please post a link to the wiki / tutorials you tried....

jeti
Magmatwister
Posts: 5
Joined: Sat Sep 11, 2010 10:25 pm

Re: Unresolved external symbols

Post by Magmatwister »

I still need help please =/
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Unresolved external symbols

Post by Erwin Coumans »

How did you create the project files exactly? Manually, or using cmake/provided in msvc folder?

There is an issue with cmake, that breaks the library dependencies feature. Try to switch the project settings for all projects, and set the Linker/Link Library dependencies to YES.
link_library_dependencies.png
link_library_dependencies.png (56.86 KiB) Viewed 11812 times
Hope this helps,
Erwin
Magmatwister
Posts: 5
Joined: Sat Sep 11, 2010 10:25 pm

Re: Unresolved external symbols

Post by Magmatwister »

First, thanks for replying and second, no unfortunately I had already done that it doesn't work. Anyway, for good measure, I just re-downloaded, extracted and went through all the steps again and there's no change. If you're wondering, i'm using visual studio 2010, cmake 2.8.2, windows 7, bullet 2.77. Perhaps the problem lies with cmake? I'm going to try to compile manually to try and eliminate more possibilities. The only visible problem I get with cmake is a "WARNING: you are using the obsolete 'GLU' package, please use 'OpenGL' instead" error, but I don't know if that affects anything.
Magmatwister
Posts: 5
Joined: Sat Sep 11, 2010 10:25 pm

Re: Unresolved external symbols

Post by Magmatwister »

Nevermind! :P
User avatar
gennoevus
Posts: 39
Joined: Sun Oct 10, 2010 4:39 am

Re: Unresolved external symbols

Post by gennoevus »

Magmatwister wrote:Nevermind! :P
Even if it was a silly mistake, you should tell us what the problem was so that if someone ever has the same problem they can look at this thread and find the solution. :D
sipickles
Posts: 44
Joined: Thu Aug 07, 2008 6:57 am

Re: Unresolved external symbols

Post by sipickles »

Did you find the problem?

I have similar problem after upgrade to 2.77. Link error with btcollisionshape::getContactBreakingThreshold :(
suvash
Posts: 1
Joined: Mon Nov 15, 2010 8:31 pm

Re: Unresolved external symbols

Post by suvash »

Magmatwister wrote:Nevermind! :P
I have almost the same setup as yours and am going through the same problem. Could you share the solution please ?
sipickles
Posts: 44
Joined: Thu Aug 07, 2008 6:57 am

Re: Unresolved external symbols

Post by sipickles »

Magmatwister wrote:Nevermind! :P
Ah I think the OP may be as embarrased as me.

I had, for some reason, changed my VS proiject to link to bullet-2.77/msvc9/libs/debug/BulletCollision.lib rather than bullet-2.77/libs/libbulletcollision.lib (likewise with libbulletdynamics.lib and libbulletmath.lib)

hth
Post Reply