New guy, nothing works, linking problems [solved]

Shadow Zone
Posts: 4
Joined: Sun Sep 21, 2008 8:34 am

New guy, nothing works, linking problems [solved]

Post by Shadow Zone »

Hi!
I'm out of idias, so please help me. I'm trying to start my first bullet application for 2 days, and nothing works so far. Always cannot find this, that, no such a library, unresolved external symbol and so on. So I'd like to ask some expert bullet guy to write me, how to set up my MVSC 2005 and my project and how to build up my working directory.
My steps were:
- Install MVSC 2005
- Install MVSC 2005 SP1
- Install Direct X Source Developer Kit (I think this is not necessary)
- Unzip bullet-2.71 to C:\bullet-2.71
- Start MSVC 2005: (and follow http://www.bulletphysics.com/mediawiki- ... ello_World
- New Project -> Win32 Console application->Empty project
- Add New Item ->Hello.cpp
- copy-paste:

Code: Select all

#include <iostream>
        int main ()
        {
                std::cout << "Hello World!" << std::endl;
                return 0;
        }
Oh, man, it is working, what a great program! All right now copy-paste the whole HelloWorld application what is on the page what I just linked in.
- build it
"Cannot open include file: 'btBulletDynamicsCommon.h' " of course not, nobody told to MSCV where to find. So:
- Project Properties->c++\General\Additional Include Directories .;..\..;..\..\src;
- Copy C:\bullet-2.71\src to Myworks\BulletHello\
Oh, man, that should be works, but wait a minute:
- build
Cannot open include file: 'btBulletDynamicsCommon.h':

Bla,bla. And of course, I tryed in many many ways. Copy everything, such as Extras, Demos, Glut, OpenGL everything to everywhere. I tryed Win32 Project. I tryed CcdPhysicsDemo, you know make a new project add CcdPhysicsDemo.cpp, and.h and main.cpp, and than copy everything to everywhere again, copy glut.h to windows\system and than copy everything even Crysis.exe to system directory just to make my computer happy :twisted: . And set up the project properties like they did in wksbullet.sln. And nothing, always something wrong cannot find glut.h, cannot find BMF_Api.cpp etc.

So Can anybody tell me step by steps that how is it possible to set up my first application and make it work? :oops:

ps.: sorry for the writing mistakes
mickey
Posts: 107
Joined: Fri Sep 19, 2008 6:08 pm

Re: New guy, nothing works, linking problems, HELP ME PLEASE

Post by mickey »

Hi Shadow

Under project->properties->linker->additional library directories should where your bullet compiled objects files are located

Under project->properties->input->additional dependencies should where you place the bullet lib names

You seem to make the right thing in setting the path for bullet header files. Otherwise that's all there is to it to start developing.

Hope that helps!

Cheers,

David
Shadow Zone
Posts: 4
Joined: Sun Sep 21, 2008 8:34 am

Re: New guy, nothing works, linking problems, HELP ME PLEASE

Post by Shadow Zone »

Thank you, yes it helped a little bit, so now:
Properties:
* C++->General->Additional Include Directories: ..\src;..\Glut;..\Glut\GL;..\Extras;..\Extras\ConvexHull;..\Demos\OpenGL;..\..\Extras\ConvexDecomposition;..\Extras\GIMPACT\include;..\Extras\GIMPACTUtils

* Linker->General->Additional Library Directories: ..\Glut

* Linker->Input->Additional Dependencies: glut32.lib

But now,when I try to build, I get this:

Code: Select all

1>Hello.cpp
1>Linking...
1>Hello.obj : error LNK2019: unresolved external symbol "public: __thiscall btRigidBody::btRigidBody(struct btRigidBody::btRigidBodyConstructionInfo const &)" (??0btRigidBody@@QAE@ABUbtRigidBodyConstructionInfo@0@@Z) referenced in function _main
1>Hello.obj : error LNK2019: unresolved external symbol "public: __thiscall btSphereShape::btSphereShape(float)" (??0btSphereShape@@QAE@M@Z) referenced in function _main
1>Hello.obj : error LNK2019: unresolved external symbol "public: __thiscall btStaticPlaneShape::btStaticPlaneShape(class btVector3 const &,float)" (??0btStaticPlaneShape@@QAE@ABVbtVector3@@M@Z) referenced in function _main
1>Hello.obj : error LNK2019: unresolved external symbol "public: __thiscall btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(class btDispatcher *,class btBroadphaseInterface *,class btConstraintSolver *,class btCollisionConfiguration *)" (??0btDiscreteDynamicsWorld@@QAE@PAVbtDispatcher@@PAVbtBroadphaseInterface@@PAVbtConstraintSolver@@PAVbtCollisionConfiguration@@@Z) referenced in function _main
1>Hello.obj : error LNK2019: unresolved external symbol "public: __thiscall btSequentialImpulseConstraintSolver::btSequentialImpulseConstraintSolver(void)" (??0btSequentialImpulseConstraintSolver@@QAE@XZ) referenced in function _main
1>Hello.obj : error LNK2019: unresolved external symbol "public: __thiscall btCollisionDispatcher::btCollisionDispatcher(class btCollisionConfiguration *)" (??0btCollisionDispatcher@@QAE@PAVbtCollisionConfiguration@@@Z) referenced in function _main
1>Hello.obj : error LNK2019: unresolved external symbol "public: __thiscall btDefaultCollisionConfiguration::btDefaultCollisionConfiguration(struct btDefaultCollisionConstructionInfo const &)" (??0btDefaultCollisionConfiguration@@QAE@ABUbtDefaultCollisionConstructionInfo@@@Z) referenced in function _main
1>Hello.obj : error LNK2019: unresolved external symbol "public: __thiscall btAxisSweep3::btAxisSweep3(class btVector3 const &,class btVector3 const &,unsigned short,class btOverlappingPairCache *)" (??0btAxisSweep3@@QAE@ABVbtVector3@@0GPAVbtOverlappingPairCache@@@Z) referenced in function _main
1>Hello.obj : error LNK2019: unresolved external symbol "void * __cdecl btAlignedAllocInternal(unsigned int,int)" (?btAlignedAllocInternal@@YAPAXIH@Z) referenced in function "public: static void * __cdecl btCollisionObject::operator new(unsigned int)" (??2btCollisionObject@@SAPAXI@Z)
1>Hello.obj : error LNK2019: unresolved external symbol "void __cdecl btAlignedFreeInternal(void *)" (?btAlignedFreeInternal@@YAXPAX@Z) referenced in function "public: static void __cdecl btCollisionObject::operator delete(void *)" (??3btCollisionObject@@SAXPAX@Z)
1>D:\Diploma\Work\Bullet 1\Debug\Bullet 1.exe : fatal error LNK1120: 10 unresolved externals
1>Build log was saved at "file://d:\Diploma\Work\Bullet 1\Bullet 1\Debug\BuildLog.htm"
1>Bullet 1 - 11 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
What now? :x It seems that I'm not able to use Bullet ever!
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: New guy, nothing works, linking problems, HELP ME PLEASE

Post by Erwin Coumans »

Have you inserted the Bullet project files into your project?

If so, make sure your own project is dependent on libbulletcollision, libbulletdynamics and libbulletmath (you probably don't need libbulletopenglsupport etc).

Right-click on your project, and select Project Dependencies, follow those pictures:
Image
Image
Last but not least, make sure that your project uses the same C++ code generation as the Bullet libraries, just right-click again on each project, and make sure the C++ code generation setting is the same (Multithreaded, Multithreaded Debug etc).
Image

Hope this helps,
Erwin

BTW: this info should go into the Wiki/documentation.
Shadow Zone
Posts: 4
Joined: Sun Sep 21, 2008 8:34 am

Re: New guy, nothing works, linking problems, HELP ME PLEASE

Post by Shadow Zone »

hm...
Shadow Zone
Posts: 4
Joined: Sun Sep 21, 2008 8:34 am

Re: New guy, nothing works, linking problems, HELP ME PLEASE

Post by Shadow Zone »

Thank you, it is working!
Image