Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rand() was not declared in this scope. #11

Closed
bram-dingelstad opened this issue Jul 21, 2014 · 2 comments
Closed

Rand() was not declared in this scope. #11

bram-dingelstad opened this issue Jul 21, 2014 · 2 comments

Comments

@bram-dingelstad
Copy link

I was trying to compile this (awesome) repo, but I ran into this error :

In file included from mono_panner.cpp:20:0:
wave.h: In static member function ‘static mopo::mopo_float mopo::Wave::whitenoise()’:
wave.h:245:28: error: ‘rand’ was not declared in this scope
         return (2.0 * rand()) / RAND_MAX - 1;
                            ^
wave.h:245:33: error: ‘RAND_MAX’ was not declared in this scope
         return (2.0 * rand()) / RAND_MAX - 1;
                                 ^
@AakashRaina
Copy link

If you intended to generate a random number,try using srand() instead.Regarding rand_max you will have to define it.

@mtytel
Copy link
Owner

mtytel commented Sep 5, 2014

#12 fixes this issue.
I don't think srand is right since it sets the seed.

@mtytel mtytel closed this as completed Sep 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants