[SOLVED] Dynamic bodies remain stationary

I feel like I'm asking a question that must have already been asked 327 times or so, but I couldn't find the answers. I started out trying to integrate Box2D into my existing game, but when I ran into this problem I toned it down to a simple program based on the "Hello Box2D" tutorial found in the manual. I quickly discovered that the problem was still there. Simply put, dynamic bodies don't seem to be effected by gravity or any other forces at all.

My assumption is always that I'm missing something, so if any of you are willing to take the time to go through this short program that would be awesome.

Code:
#include <iostream>
#include <Box2D/Box2D.h>

using namespace std;


int main()
{
   b2World world(b2Vec2(0.0f,-10.0f), true);

   b2BodyDef groundDef;
   groundDef.position.Set(0.0f,-10.0f);

   b2Body * ground = world.CreateBody(&groundDef);
   b2PolygonShape groundShape;
   groundShape.SetAsBox(50.0f,10.0f);
   ground->CreateFixture(&groundShape, 0.0f);

   b2BodyDef boxDef;
   boxDef.type = b2_dynamicBody;
   boxDef.position.Set(0.0f,4.0f);

   b2Body * box = world.CreateBody(&boxDef);

   b2PolygonShape boxShape;
   boxShape.SetAsBox(1.0f,1.0f);

   b2FixtureDef fixDef;
   fixDef.shape = &boxShape;
   fixDef.density = 1.0f;
   fixDef.friction = 0.3f;

   box->CreateFixture(&fixDef);

   for(int i = 0; i < 60; ++i)
   {
      world.Step(1/60, 6, 2);

      cout << box->GetPosition().x << ',' << box->GetPosition().y << '\n';
   }

   return 0;
}


The output is sixty lines reading "0,4". I compiled my Box2D version(2.2.0) myself with gcc version 4.6.1. Any insight would be much appreciated.
Here's what I get with the SVN version:

Code:
0.00 4.00 0.00
0.00 3.99 0.00
0.00 3.98 0.00
0.00 3.97 0.00
0.00 3.96 0.00
0.00 3.94 0.00
0.00 3.92 0.00
0.00 3.90 0.00
0.00 3.87 0.00
0.00 3.85 0.00
0.00 3.82 0.00
0.00 3.78 0.00
0.00 3.75 0.00
0.00 3.71 0.00
0.00 3.67 0.00
0.00 3.62 0.00
0.00 3.57 0.00
0.00 3.52 0.00
0.00 3.47 0.00
0.00 3.42 0.00
0.00 3.36 0.00
0.00 3.30 0.00
0.00 3.23 0.00
0.00 3.17 0.00
0.00 3.10 0.00
0.00 3.02 0.00
0.00 2.95 0.00
0.00 2.87 0.00
0.00 2.79 0.00
0.00 2.71 0.00
0.00 2.62 0.00
0.00 2.53 0.00
0.00 2.44 0.00
0.00 2.35 0.00
0.00 2.25 0.00
0.00 2.15 0.00
0.00 2.05 0.00
0.00 1.94 0.00
0.00 1.83 0.00
0.00 1.72 0.00
0.00 1.61 0.00
0.00 1.49 0.00
0.00 1.37 0.00
0.00 1.25 0.00
0.00 1.13 0.00
0.00 1.01 0.00
0.00 1.01 0.00
0.00 1.01 0.00
0.00 1.01 0.00
0.00 1.01 0.00
0.00 1.01 0.00
0.00 1.01 0.00
0.00 1.01 0.00
0.00 1.01 0.00
0.00 1.01 0.00
0.00 1.01 0.00
0.00 1.01 0.00
0.00 1.01 0.00
0.00 1.01 0.00
0.00 1.01 0.00
I must have screwed up the build. I'll try rebuilding SVN to see if it works. Thx.
Just a minute. I think I'm probably screwing up the way I read the tutorial. The code is something I did myself, with a few differences(like cout instead of printf and such.) So there is probably a difference between my code and what I was instructed to do that would break the simulation. I just haven't been able to spot it myself. Perhaps if someone could try compiling my code it would show if the problem was with the way I built Box2D, or if I'm just not doing it right.
Kind of update: I copy/pasted from the manual, and that worked properly. So I'm re-examining my code for inconsistencies again.
Yep, fixed it. I apparently just needed a brush-up on handling floating point numbers. Feels kind of dumb to post here and then fix it myself... Oh well, confessional debugging I guess.
Thank you for posting about the solution too 🙂. Whether you solve it yourself or not, it is better if the thread has useful information 🙂.

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