hello world compile error

Moustique
Posts: 6
Joined: Tue Aug 03, 2010 4:15 pm

hello world compile error

Post by Moustique »

Hello all,
I am new for Bullet, when I built Bullet "Hello world" application (create a ground plane and some spheres).

But I met link errors:

error LNK2001: unresolved external symbol "public: virtual void __thiscall btCollisionShape::getBoundingSphere(class btVector3 &,float &)const " (?getBoundingSphere@btCollisionShape@@UBEXAAVbtVector3@@AAM@Z)
1>First_Bullet.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getAngularMotionDisc(void)const " (?getAngularMotionDisc@btCollisionShape@@UBEMXZ)
1>First_Bullet.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getContactBreakingThreshold(float)const " (?getContactBreakingThreshold@btCollisionShape@@UBEMM@Z)
1>First_Bullet.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btSphereShape::calculateLocalInertia(float,class btVector3 &)const " (?calculateLocalInertia@btSphereShape@@UBEXMAAVbtVector3@@@Z)
1>C:\Documents and Settings\zhwang\My Documents\My PhD\CODE in progress\code\Ogre Physics\OgreBullet\Bullet_Start\First_Bullet\Debug\First_Bullet.exe : fatal error LNK1120: 5 unresolved externals

I have linked BulletCollision.lib and BulletDynamics.lib and linearMath.lib,
the errors still exist!

I am dying and looking forward to your kind reply.

regards

---
zwang
Rob_Theed
Posts: 7
Joined: Thu Jul 29, 2010 10:16 am
Location: Taunton UK

Re: hello world compile error

Post by Rob_Theed »

How about header search paths to your header files? But I wouldn't have thought that would give those errors.
Moustique
Posts: 6
Joined: Tue Aug 03, 2010 4:15 pm

Re: hello world compile error

Post by Moustique »

Rob_Theed wrote:How about header search paths to your header files? But I wouldn't have thought that would give those errors.
Hello,
thank you for your reply,
but the errors really happened. i think there is no problem of header files searching, if so there would have been some errors, like "can not open .h file".

I am thinking about the lack of lib files but I did not know which lib files are exactly needed, since I have added necessary lib files.

thank you for your help.

regards

zwang
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Re: hello world compile error

Post by Dragonlord »

No, this is not a library not found error but a symbol not found error. Where did you get the library files from? If possible build them yourself or simply add the source files into your project. Ranlib them first into a library if required (windows 32k command limit bug).
Moustique
Posts: 6
Joined: Tue Aug 03, 2010 4:15 pm

Re: hello world compile error

Post by Moustique »

Dragonlord wrote:No, this is not a library not found error but a symbol not found error. Where did you get the library files from? If possible build them yourself or simply add the source files into your project. Ranlib them first into a library if required (windows 32k command limit bug).
Hello
Thank you for your reply,
and I followed ypur advice and just add the header files in my project, but unfortunately,
I failed again.

I could not figure out which files (header file or lib file) are missed.

Looking forward to your help!

---
zwang
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Re: hello world compile error

Post by Dragonlord »

I meant header files and source files (*.h and *.cpp) from bullet. The lib file is most probably lacking certain source files so add what you need. In general you need the source files except the BulletExtras ones.
Moustique
Posts: 6
Joined: Tue Aug 03, 2010 4:15 pm

Re: hello world compile error

Post by Moustique »

Dragonlord wrote:I meant header files and source files (*.h and *.cpp) from bullet. The lib file is most probably lacking certain source files so add what you need. In general you need the source files except the BulletExtras ones.

Hello
Thank you for your reply,
and i followed your advice but still exist those errors.

I really do not understand.

reagrds

---
moustique
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Re: hello world compile error

Post by Dragonlord »

Are you compiling with the bullet .cpp files or the .lib files? As mentioned, try without the lib files but compiling in the .cpp files from the Bullet distribution. This also includes LinearMath or how the directory is called. If you include the .cpp files in there the symbols should exist otherwise you have a seriously broken distribution.