How to build bullet on windows (for MinGW)

GameOn
Posts: 35
Joined: Mon Dec 27, 2010 10:46 pm

How to build bullet on windows (for MinGW)

Post by GameOn »

Hi there,

Does anyone know how to do that ?
I've looked around for quite a bit and found nothing for windows.
all I found were linux tutorials.

Thanks ahead.
Last edited by GameOn on Thu Jan 06, 2011 12:03 am, edited 2 times in total.
GameOn
Posts: 35
Joined: Mon Dec 27, 2010 10:46 pm

Re: How to compile bullet on windows

Post by GameOn »

...oh, and by the way I'm trying to compile it for use with irrlicht 3D engine and Codeblock IDE (thus minGW compiler/builder... which isn't exactly the same as visual studio AFAIK :lol:),

idk if this does has any impact but I'm just pointing this out just in case.

PS : thanks to point any non-sense I might have wrote in these 2 posts if there is any.
GameOn
Posts: 35
Joined: Mon Dec 27, 2010 10:46 pm

Re: How to build bullet on windows

Post by GameOn »

So if I understood properly, it's impossible to build anything using cmake ?

all it does is cleaning the path for visual c++ ?
GameOn
Posts: 35
Joined: Mon Dec 27, 2010 10:46 pm

Re: How to build bullet on windows

Post by GameOn »

Still trying to figure out how it works, maybe il succeed somehow.

You can be sure il write down a tutorial on how to get started with bullet & irrlicht once I can figure it out myself.

Heh, to think I once though "okay, I got a 3D rendering engine to works, let's see how easy it's gonna be to add a physic engine to the pot beside that" ehehehe

...silly me. :oops:
GameOn
Posts: 35
Joined: Mon Dec 27, 2010 10:46 pm

Re: How to build bullet on windows

Post by GameOn »

whoohoo, I has been spammed already :lol:

Image
GameOn
Posts: 35
Joined: Mon Dec 27, 2010 10:46 pm

Re: How to build bullet on windows

Post by GameOn »

Okay,

so I've been thinking, what if I just include all the .cpp and .h files of bullet into my project. Would this works ?

I'm gonna try that because it looks awfully simpler than trying to figure out how to build compiled libraries of bullet for mingw (.a files) with the zero support I have around here. idk if nobody know how to build bullet or if you're all just ignoring me for some reasons, but I cannot figure out why is this physic engine so popular :?
...although there's not so many alternatives.


anyways, all I'd need to know is if there is a way to create something such as a "Main header file"... which would be a single .h file I would just have to include in a source code that require bullet access. I'm asking that because it would be cool not to have to include all the many headers that come with bullet every time a class is using bullet.


PS : I hope this spammer is gonna come around soon, he seem to be the only help I can get :lol:
consequence
Posts: 3
Joined: Thu Dec 30, 2010 11:23 pm

Re: How to build bullet on windows

Post by consequence »

It's pretty simple, actually. You'll need CMake (cmake.org) and MinGW, which you probably already have since you use CodeBlocks, as do I.

Run CMake-gui.exe from wherever you installed it. You should see two fields: one for source directory, and one for output. Make the source directory the one that contains Bullet's files, and make the output whatever you want, though I suggest making it a folder other than the source directory. CMake should print up a list of options for your build, such as whether to make demos, etc., but for simplicity's sake just use the default settings. Press 'Configure' and when the option comes up, choose 'MinGW Makefiles'. When configuring is complete, press 'Generate'.

CMake should have put a MinGW makefile in the directory you chose for output. Make sure Windows has your MinGW/bin folder in the system PATH, and then start a command prompt in that output directory. (In recent versions of Windows, you can just shift-right-click inside the folder and choose 'Open Command Window here'.) Now, simply type in 'mingw32-make' to build the libraries.

You might get errors if you don't have certain other libraries, like GLUT. If that's the case, try unchecking all the options in CMake-gui, and then configure and generate again.

If all goes well, the output directory should now have a 'lib' directory that contains all your .a files, while the .h files can all be taken from bullet-2.77/src.

If you have any trouble, just ask. My setup is pretty much the same as yours, and I have Bullet working fine.
GameOn
Posts: 35
Joined: Mon Dec 27, 2010 10:46 pm

Re: How to build bullet on windows

Post by GameOn »

Awesome !

Thanks you so much consequence,

il give it a try.
GameOn
Posts: 35
Joined: Mon Dec 27, 2010 10:46 pm

Re: How to build bullet on windows

Post by GameOn »

Make sure Windows has your MinGW/bin folder in the system PATH
How do I do that ?

...and there doesn't seem to be a way for me to open a command promp in the selected directory as you described. Should I write a .bat file with the "mingw32-make" command in it and launch it from the folder ? (When I try that nothing happen but I musn't have MinGW/bin in my system path as I don't know how to do that)
GameOn
Posts: 35
Joined: Mon Dec 27, 2010 10:46 pm

Re: How to build bullet on windows

Post by GameOn »

I found out how to add "C:\MinGW\bin" into my system paths, thanks to this link :
http://www.windowsitpro.com/article/con ... path-.aspx

Il try and see if I can get a command prompt to does the rest of the job...
GameOn
Posts: 35
Joined: Mon Dec 27, 2010 10:46 pm

Re: How to build bullet on windows

Post by GameOn »

Strange, I succeeded to launch the command prompt from the building directory using a .bat file with the "cmd.exe" instruction in it. I also succeeded to add "C:\MinGW\bin" to the system paths, yet when I paste "mingw32-make" in the command prompt the following error occur :

Image
GameOn
Posts: 35
Joined: Mon Dec 27, 2010 10:46 pm

Re: How to build bullet on windows

Post by GameOn »

I really have no idea what's wrong...

MinGW seem to be installed properly...
...and the prompt window is finding "mingw32-make"
...but it seems like a path cannot be found... idk what these *** mean.

....neither do I know what the rest of the sentence mean.

PS : the french sentence mean "the access path cannot be found"
GameOn
Posts: 35
Joined: Mon Dec 27, 2010 10:46 pm

Re: How to build bullet on windows (for MinGW)

Post by GameOn »

I am wondering,

When configuring the project using cmake,
which options need to be turned on / off before generating the thing ?

PS : I finally got make to works, looks like I had to install Cmake (and add it to the system paths (which is done automatically)) rather than just hide it somewhere using the zip installer.

PPS : whooohooo ! It build properly ! ...I guess.
All I had to do at this point was to delete the demo folder of the source so that it doesn't try and build thoses (and fail at doing so)

PPPS : where are the headers ? All I have is the compiled libraries (.a files yea !).
Should I use those from the src folder of the source ?

PPPPS : where are the dynamic libraries (.dll files) ? Is there any to include any in my distributed apps ?
winspear
Posts: 77
Joined: Thu Nov 26, 2009 6:32 pm

Re: How to build bullet on windows (for MinGW)

Post by winspear »

Bullet is all static libs. No dll's. I think it is better this way since it is a pain in the butt to work with DLL's.
The headers are all in th BULLET_PARENT_DIR/src directory and so just add this path to additional include folders.
GameOn
Posts: 35
Joined: Mon Dec 27, 2010 10:46 pm

Re: How to build bullet on windows (for MinGW)

Post by GameOn »

It didn't worked, what a surprise.

That's what I get when trying to compile the helloworld example :
(same thing happen no matter what example I compile)

Image

Image

anyone know why bullet seem to use references that it haven't defined ?
or what mistake I'm doing since it's probably my fault.

PS : thanks for the explanation winspear.

PPS : what's the big deal with .dll ? All you have to do is place them in your game/apps's folder and voila. 10 seconds (if you're kind of tired & slow) and you're done. It's been now 10 days since I started messing with bullet and I can still not make a $&/"$ simple ball to collide with a $?"&!$ simple plane. 10 days.

10 days.

....what am I missing....