I am taking a Computer Graphics course where we are doing some c++ programming using the OpenGL API. I'm writing a C++ program in Visual Studio.NET, where I've installed GLUT (Open GL Utility Toolkit). OpenGL, itself, apparently comes with VS.
The only include that I have in my one-file program is:
The program works fine up until the point where I need to randomize a number. When I try including stdlib.h or cstdlib in my file, I get an error message about redefinition and my program won't compile.
In the textbook the class is using, it shows rand() being used without having to include anything extra. I'm assuming it's somehow built into glut.h? However, even when I copy code directly out of a textbook example, I get the error message "unresolved external symbol referenced in function" and then "fatal error: 1 unresolved externals"
When I remove the line or two referencing rand() in my program, once again it compiles and runs fine. Please, how can I generate a random number from within an OpenGL program?