Setting up Bullet in project & build environment

MrCase
Posts: 4
Joined: Wed Aug 27, 2008 10:24 pm

Setting up Bullet in project & build environment

Post by MrCase »

Hi there and congratulations on the nice software and community, it feels like a place to stay,

We came across Bullet while we're looking for physics support for the C4 Engine which we're using for a project. Since Bullet supports some platforms which are important to us and since the source code is open we decided to have a go with it, instead of PhysX. Bullet's past proof of concept for C4 made our decision even easier and we'll get it to run with C4 (again).

While having a (quick) look at the makefiles and code of Bullet I realized that there are no __declspec(dllexport)/__declspec(dllimport) defines which would allow to use Bullet as DLL(s) with MS' linker, just some extern statements here and there. Don't get me wrong, I am coming from Linux and I don't like the way how one has to expose the APIs with MS-style DLLs.

I guess Bullet is supposed to be linked statically?

Are there any plans to make life easier for peeps who want dynamic linking? Maybe some kind of a list with stuff that needs to be externalized? Or shall I just DLL-export/import everything that is included from btBulletDynamicsCommon.h and btBulletCollisionCommon.h.

I'd like to keep the hassle low when updating to a new version of Bullet.

Thank you for any constructive input on this issue in advance.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Setting up Bullet in project & build environment

Post by Erwin Coumans »

MrCase wrote:While having a (quick) look at the makefiles and code of Bullet I realized that there are no __declspec(dllexport)/__declspec(dllimport) defines which would allow to use Bullet as DLL(s) with MS' linker, just some extern statements here and there. Don't get me wrong, I am coming from Linux and I don't like the way how one has to expose the APIs with MS-style DLLs.

I guess Bullet is supposed to be linked statically?
Indeed, it is a static library, just like Havok.
Are there any plans to make life easier for peeps who want dynamic linking?
Bullet has been used in several plugins/dlls. But those dll's don't export the Bullet C++ API. They just use "Multi-threaded DLL Code Generation" settings.

Why do you need to export Bullet C++ classes? You will practically need to export every single structure and class, which means that a host program using that plugin will need to include all Bullet header files. If you really want to export Bullet as a plugin, you could invest in the work-in-progress C-API, and export that.

Can you explain why Bullet C++ classes should be exported? Can't you keep Bullet statically inside the plugin, and expose/communicate C4 data structures between host and plugin?

Thanks for you feedback,
Erwin
MrCase
Posts: 4
Joined: Wed Aug 27, 2008 10:24 pm

Re: Setting up Bullet in project & build environment

Post by MrCase »

No real reasons Erwin, just wondering. I'll keep Bullet statically inside the game plug-in of C4 as suggested. Thank you for your input :-).