irrBP - An Irrlicht - Bullet Physics Wrapper

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, having 'using namespace' in your cpp files is not considered best practice, but will not harm others. Having it in your header files pretty often breaks apps which use your lib. I guess it's not what your header files are intended for. So always use fully quoted names in headers.
Zurzaza
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy
Contact:

Post by Zurzaza »

thank you for your reply & for your tips.
I've just ended of "cleaning" the source code from the "using namespace " instruction. Now all headers and a lot of .cpp files don't contain using namespace declaration.

You can download the lastest svn version (r51) to apply the changes

Have a good day ;)
irrBP - an Irrlicht - Bullet Physics Wrapper.
The only irrlicht-physics wrapper that uses multithread technology.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Zurzaza wrote:thank you for your reply & for your tips.
I've just ended of "cleaning" the source code from the "using namespace " instruction. Now all headers and a lot of .cpp files don't contain using namespace declaration.

You can download the lastest svn version (r51) to apply the changes

Have a good day ;)
Good news :)
I'll try it out when I'll be reimplementing physics into my project.
Working on game: Marrbles (Currently stopped).
panto
Posts: 22
Joined: Thu Mar 17, 2011 5:44 pm

Post by panto »

Is there a tutorial on how to add IrrBP to your project? I included all of the Bullet libraries and the IrrBP library using pragma comments, then "IrrBP.h" to my project and every Bullet's header files to IrrBP header files folder.

I tried compiling but it gave me a bunch of linker errors. Any advice would be appreciated. Also, I'm new to C++ so please don't be harsh on me if I made a silly mistake.
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post by randomMesh »

panto wrote:I tried compiling but it gave me a bunch of linker errors. Any advice would be appreciated.
An the error message is? :o
"Whoops..."
panto
Posts: 22
Joined: Thu Mar 17, 2011 5:44 pm

Post by panto »

It had quite a lot of Linker errors, mainly LNK2005.

For now, I have removed all traces of IrrBP.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

panto wrote:It had quite a lot of Linker errors, mainly LNK2005.

For now, I have removed all traces of IrrBP.
.... Post actual error messages or at least the first ones.
Working on game: Marrbles (Currently stopped).
Zurzaza
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy
Contact:

Post by Zurzaza »

Did you read the warning message in the documentation?
Important NOTE: If you use a bullet version, different from the irrBP official bullet supported version (2.76 right now), you must pay attention when compiling BULLET PHYSICS: To avoid linking problems in your project you need to verify (and even change) that the runtime library in BULLET_PHYSICS project is setted to "MultiThreaded".
maybe is this the problem? Try to test this solution and give me a feedback.
If this way doesn't work, can you provide the errors?

Thanks
irrBP - an Irrlicht - Bullet Physics Wrapper.
The only irrlicht-physics wrapper that uses multithread technology.
panto
Posts: 22
Joined: Thu Mar 17, 2011 5:44 pm

Post by panto »

I now tried recompiling IrrBPLib.lib using Multi-Threaded as runtime library. Result? Still a bunch of linker errors. I'm giving up, I've wasted ~3 hours of my time trying to fix this.

I appreciate the work you've put to this, seems solid enough and apparently the people who can actually use this enjoy it.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

panto wrote:I now tried recompiling IrrBPLib.lib using Multi-Threaded as runtime library. Result? Still a bunch of linker errors. I'm giving up, I've wasted ~3 hours of my time trying to fix this.

I appreciate the work you've put to this, seems solid enough and apparently the people who can actually use this enjoy it.
Its not hard to use when you follow the instructions, just read few pages back and you'll see other people having linker errors too.
Working on game: Marrbles (Currently stopped).
panto
Posts: 22
Joined: Thu Mar 17, 2011 5:44 pm

Post by panto »

This is what I did, step-by-step.

1) Included IrrBP header files.
2) Included Bullet 2.76 header files.
3) Added all bullet libraries from IrrBullet to the project (I compiled fine and was able to use IrrBullet with those libraries under Multi Threaded DLL).
4) Added IrrBPLib.lib (Recompiled as Multi Threaded DLL) to the project.

Then I tried compiling, and this is what I get. (I compile as Release, Multi Threaded DLL)

Code: Select all

1>  Generating Code...
1>  IrrBPLib.lib(CIrrBPWorld.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>IrrBPLib.lib(CIrrBPWorld.obj) : error LNK2001: unresolved external symbol "public: __thiscall btSoftRigidDynamicsWorld::btSoftRigidDynamicsWorld(class btDispatcher *,class btBroadphaseInterface *,class btConstraintSolver *,class btCollisionConfiguration *)" (??0btSoftRigidDynamicsWorld@@QAE@PAVbtDispatcher@@PAVbtBroadphaseInterface@@PAVbtConstraintSolver@@PAVbtCollisionConfiguration@@@Z)
1>IrrBPLib.lib(CIrrBPHingeConstraint.obj) : error LNK2001: unresolved external symbol "public: __thiscall btHingeConstraint::btHingeConstraint(class btRigidBody &,class btRigidBody &,class btVector3 const &,class btVector3 const &,class btVector3 &,class btVector3 &,bool)" (??0btHingeConstraint@@QAE@AAVbtRigidBody@@0ABVbtVector3@@1AAV2@2_N@Z)
1>IrrBPLib.lib(CIrrBPHingeConstraint.obj) : error LNK2001: unresolved external symbol "public: __thiscall btHingeConstraint::btHingeConstraint(class btRigidBody &,class btVector3 const &,class btVector3 &,bool)" (??0btHingeConstraint@@QAE@AAVbtRigidBody@@ABVbtVector3@@AAV2@_N@Z)
This is the order of how I add the libraries.

Code: Select all

#pragma comment( lib, "Irrlicht.lib" )
#pragma comment( lib, "BulletDynamics.lib" )
#pragma comment( lib, "BulletSoftBody.lib" )
#pragma comment( lib, "LinearMath.lib" )
#pragma comment( lib, "BulletCollision.lib" )
#pragma comment( lib, "IrrBPLib.lib" )
What am I doing wrong?
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

I don't think that its enough to just pragma the libraries, you also should include them in the linker options, tough I can't remember how to do it in msvc.
And look for the order of libs a few pages back in this thread.
Working on game: Marrbles (Currently stopped).
panto
Posts: 22
Joined: Thu Mar 17, 2011 5:44 pm

Post by panto »

Thanks for the fast reply.

I added all the libraries under Project Options -> Linker -> Input -> Additional Dependencies.

The order is:
Irrlicht.lib
BulletDynamics.lib
BulletSoftBody.lib
LinearMath.lib
BulletCollision.lib
IrrBPLib.lib

Yet I still get the same error. I'll try looking for the proper order in this thread, I guess.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Working on game: Marrbles (Currently stopped).
panto
Posts: 22
Joined: Thu Mar 17, 2011 5:44 pm

Post by panto »

Order of libraries..
BulletSoftBody.lib
BulletDynamics.lib
BulletCollision.lib
LinearMath.lib
Irrlicht.lib
IrrBPLib.lib

Compiling using Multi Threaded DLL. IrrBPLib is also re-compiled under Multi Threaded DLL.
Error:

Code: Select all

1>------ Build started: Project: IrrRPG, Configuration: Release Win32 ------
1>  EventReceiver.cpp
1>  Main.cpp
1>  RGame.cpp
1>  Generating Code...
1>  IrrBPLib.lib(CIrrBPWorld.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>IrrBPLib.lib(CIrrBPWorld.obj) : error LNK2001: unresolved external symbol "public: __thiscall btSoftRigidDynamicsWorld::btSoftRigidDynamicsWorld(class btDispatcher *,class btBroadphaseInterface *,class btConstraintSolver *,class btCollisionConfiguration *)" (??0btSoftRigidDynamicsWorld@@QAE@PAVbtDispatcher@@PAVbtBroadphaseInterface@@PAVbtConstraintSolver@@PAVbtCollisionConfiguration@@@Z)
1>IrrBPLib.lib(CIrrBPHingeConstraint.obj) : error LNK2001: unresolved external symbol "public: __thiscall btHingeConstraint::btHingeConstraint(class btRigidBody &,class btRigidBody &,class btVector3 const &,class btVector3 const &,class btVector3 &,class btVector3 &,bool)" (??0btHingeConstraint@@QAE@AAVbtRigidBody@@0ABVbtVector3@@1AAV2@2_N@Z)
1>IrrBPLib.lib(CIrrBPHingeConstraint.obj) : error LNK2001: unresolved external symbol "public: __thiscall btHingeConstraint::btHingeConstraint(class btRigidBody &,class btVector3 const &,class btVector3 &,bool)" (??0btHingeConstraint@@QAE@AAVbtRigidBody@@ABVbtVector3@@AAV2@_N@Z)
1>C:\Users\Alex\Documents\Visual Studio 2010\Projects\IrrRPG\Release\IrrRPG.exe : fatal error LNK1120: 3 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Post Reply