R – Basic Open GL/GLUT Issue

glutgraphicsopengl

I am studying graphics and currently using OpenGL with GLUT. Doing my editing in codeblocks and using an online tutorial located at lighthouse3d. I am using the main method declared on that page however it will not let me compile. The error message consists of the main method not returning an int, I have "played" with the code enough to say I am confused. The GLUT Library is installed, and I do not see where the error is coming from.

Thank you,
Zach Smith

Best Answer

You probably have a method like this:

void main(int argc, char** argv) {
    // The code...
}

Change it to this:

int main(int argc, char** argv) {
    // The code...
    return 0;
}
Related Topic