# 2D rigid bodies - working tutorial?

This topic is 3985 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

ive found several tutorials but gotten none of them to compile due to the fact that all needed libs are never included, and when i find the libs and headers it needs they are wrong versions etc etc. So: 1. Is there any code doing box-box rigid body example that included ALL it needs to be compiled? (so i can start to disect and understand) 2. How hard is it to make it myself? What i need is cars (rectangles) bumping into other cars, trees etc. I realize its much more simple if i skip rotation + consider all bodies circular... thanks a lot E

##### Share on other sites
1. Box2D

2. That really depends on your level of math and your comprehension of physics.

May I say, you are very unlikely to understand what is going on just by looking at the code. You'll need to read the tutorial on the website, and its rather math heavy. Good calculus and linear algebra basics at least.

##### Share on other sites
thanks Steadtler, the precompiled is very clear and just what im after. It doesnt compile though...

E:\GDC2006_ErinCatto\Box2D\World.cpp(19) : error C2653: 'set<struct Arbiter,struct std::less<struct Arbiter>,class std::allocator<struct Arbiter> >' : is not a class or namespace nameE:\GDC2006_ErinCatto\Box2D\World.cpp(19) : error C2146: syntax error : missing ';' before identifier 'ArbIter'E:\GDC2006_ErinCatto\Box2D\World.cpp(19) : fatal error C1004: unexpected end of file found//And loads of this:E:\GDC2006_ErinCatto\Box2D\World.cpp(114) : error C2374: 'i' : redefinition; multiple initialization

am i doing something wrong? Thanks for your help

##### Share on other sites
Ok, not exactly box-box, but olii has some good collision tutorials.. definitely worth the check

##### Share on other sites
Chipmunk

It's solid, fast, and open source. Only trouble I've found is that the MSVC++ compiler seems to hate the code. If you have GCC, use that instead to compile it.

##### Share on other sites
dont wanna nag but same thing with chipmunk: looks cool, doesnt compile... And yes i use MSVC++ :)

##### Share on other sites
What compiler are you using? This version of Box2D is known to compile on VS2003, 2005, and on Linux with GCC (with small changes):

Latest Box2D

##### Share on other sites
vc++ 6.0
see above for what errors it gives me. Should i just include all files and make a project of it or what? Thats what i did and it produced those errors.

If i try with the lite it instead:
_CRTIMP __declspec(noreturn) void __cdecl exit(__in int _Code);//compiler complains about that linebox2d_lite\glut.h(147) : error C2065: '__in' : undeclared identifier

Plz help :)

##### Share on other sites
Quote:
 Original post by sulimanvc++ 6.0Plz help :)

Get rid of 6.0. It's a horrible compiler that can't compile valid code. Upgrade to MSVC 2005 express edition (and install the PlatformSDK too). It's free and a good compiler

That's why nothing is compiling for you. Your compiler is broken.

Example (this is illegal in 6.0 but is perfectly correct code
for ( int i = 0; i < something; ++i ){}for ( int i = 0; i < something; ++i ){}

it thinks that i is declared one level of scope up, instead of inside the for loop scope. That's what all those duplicate errors are about.

-me

##### Share on other sites
i cannot have service pack 2 so thats not possible... My windows is broken!

1. 1
2. 2
Rutin
19
3. 3
JoeJ
16
4. 4
5. 5

• 30
• 22
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631700
• Total Posts
3001800
×