Cannot install Box2D properly on OSX Mavericks

Post your tutorials and samples here.
owenfar
Posts: 2
Joined: Mon Mar 31, 2014 11:42 am

Cannot install Box2D properly on OSX Mavericks

Postby owenfar » Mon Mar 31, 2014 12:13 pm

Please help me on this one. I'll appreciate it so much! I'm new to Box2D and I've read a lot about it and it seems an awesome Physics engine that I would like to start learning and using.

I want to start with some basics, but when I got to the installation I got stuck. I've been trying for a week, and slowly losing hope, searching online and in these forums, but it doesn't seem that anyone else is having the same problem. I followed the instructions from the folder of Box2D, the installation goes well but it gets stuck at 98% as can be seen below:

151 warnings generated.
[ 98%] Building CXX object Testbed/CMakeFiles/Testbed.dir/Framework/Main.cpp.o
In file included from /Users/Owen/Applications/Box2D_v2.3.0/Box2d/Testbed/Framework/Main.cpp:20:
/Users/Owen/Applications/Box2D_v2.3.0/Box2d/Testbed/Framework/Test.h:38:24: error:
no member named 'rand' in namespace 'std'; did you mean simply 'rand'?
float32 r = (float32)(std::rand() & (RAND_LIMIT));
^~~~~~~~~
rand
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/stdlib.h:159:6: note:
'rand' declared here
int rand(void);
^
In file included from /Users/Owen/Applications/Box2D_v2.3.0/Box2d/Testbed/Framework/Main.cpp:20:
/Users/Owen/Applications/Box2D_v2.3.0/Box2d/Testbed/Framework/Test.h:47:24: error:
no member named 'rand' in namespace 'std'; did you mean simply 'rand'?
float32 r = (float32)(std::rand() & (RAND_LIMIT));
^~~~~~~~~
rand


From the research I did it looks like X11 is not available anymore on 10.9 and could affect Box2D.. And a lot of 'deprecated in OSX 10.9' warnings during installation as well.

1) Is anyone else having any problems installing Box2D on OSX 10.9.2? Tell me if its just my machine
2) Do you know if this has been already answered? Please redirect me to it

Thanks a lot!

irresistible force
Posts: 1991
Joined: Tue Jun 24, 2008 8:25 pm
Location: Tokyo
Contact:

Re: Cannot install Box2D properly on OSX Mavericks

Postby irresistible force » Tue Apr 01, 2014 2:07 pm

I guess the first question would be, did you try using just 'rand' instead of 'std::rand' ??

owenfar
Posts: 2
Joined: Mon Mar 31, 2014 11:42 am

Re: Cannot install Box2D properly on OSX Mavericks

Postby owenfar » Tue Apr 01, 2014 11:11 pm

OMG... How stupid, didn't even got to me just to change that! Since it was part of the original file, thought it was just something wrong with my Mac.
It WORKED.. So all you have to do is change the Test.h (std::rand() to only rand())

Than for the Testbed to work you'll also have to download Xquartz (https://xquartz.macosforge.org/landing/)

Thanks for your tip.. was a bit stupid on my side :)

THANK YOU!!


Return to “Tutorials and Samples”



Who is online

Users browsing this forum: No registered users and 1 guest