Box2D for MacOS

Hello,

I ve modified the Makefile from KIAaze:
viewtopic.php?f=5&t=103

to compile box2d to MacOS.

Basically you need to change all the
#include <GL/glut.h>
by
#include <GLUT/glut.h>

and in the makefiles:
use:
g++ -o $(LIBNAME) *.o -fpic -dynamiclib

to create the dynamic libraries

Use:
-framework GLUT -framework OpenGL

for the compiler options and for the linker options

And to compile the examples you ll need to change the options:
CFLAGSL32=-I../../Include -I../../Contrib/ -framework GLUT -framework OpenGL
LDFLAGSL32=-I../../Include -I../../Contrib/ -framework GLUT -framework OpenGL ../../Library/libbox2d.so ../../Library/libglui.so
I've put together an Xcode IDE project that builds the library and examples on Mac OS X 10.5. (Thanks in part to your tips, dlpnet!)

Right now I'm working off of a downloaded 1.4.2 release, but now that it's working I'll check out TOT from SVN, apply my changes to it, and then post a patch here.
OK, here's a patch based on SVN rev 49, the current top-of-tree.
The Xcode project file is in Build/Xcode/, and its output will appear in a 'build' subdirectory.

I've only tested this with OS X 10.5 "Leopard", but I set everything up so that it ought to build in 10.4 too.

--Jens Alfke
For some reason the forum wouldn't allow me to upload the file. It kept saying "extension not allowed" no matter what filename extension I used (even none).

I've uploaded it to my website; it's at http://mooseyard.com//Box2D_r49%2BMacXcodeSupport.patch

--Jens
Thanks. I'll apply the patch for the next release (might be a couple weeks).

Also, I changed the attachment settings to accept plain text (*.patch included). Please give a try if you like.
Here's a slightly updated version of the Build/Xcode/ subdirectory. This now supports building TestBed as a double-clickable app (previously it could only be run from within the Xcode IDE.)

I can't test out the plain-text attachment support, though, as I had to package this in a Zip archive because it contains a binary file (the file icon for the app.)
Hello,

good snej thanx for the Xcode project 🙂
Huge thanks to both Erin for the engine and snej for the Xcode project, great work.
I'll play around with it this weekend and see what I can come up with in terms of demos and stuff.
This is now in SVN.

Original thread: https://box2d.org/forum/viewtopic.php?t=104