Page 1 of 1

Error: 'rnd_1' was not declared in the scope

Posted: Mon Jan 21, 2013 3:27 am
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!

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

Posted: Mon Jan 21, 2013 4:31 am
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;
}