Error: 'rnd_1' was not declared in the scope

General discussion about Box2D tutorials
Post Reply
vkreal
Posts: 66
Joined: Sun Jan 13, 2013 7:29 pm

Error: 'rnd_1' was not declared in the scope

Post by vkreal »

Hi peps,

I am very new to c++ and getting compiled error "Error: 'rnd_1' was not declared in the scope" tutorial buoyancy. I can't seem to find where 'rnd_1' is defined. I am using Code::Blocks. any help would be greatly appreciated!

Thanks!
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Error: 'rnd_1' was not declared in the scope

Post by iforce2d »

oh. I seem to have defined that in the hovercar suspension test and then forgot that it was not part of the testbed. Those test headers all get included one after another so it's easy to forget about that. It's just:

Code: Select all

//random number between 0 and 1
float rnd_1()
{
    return rand() / (float)RAND_MAX;
}
Post Reply