开发者

Basic Open GL/GLUT Issue

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 howev开发者_JS百科er 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


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;
}


The problem is that you are not linking the needed libraries.

Go to the project properties by right clicking on the project icon in the 'Solution Explorer' and click on 'Properties'. Then go under 'Configuration Properties' -> 'Linker' -> 'Input' and add the following libraries to the 'Additional Dependencies' field:

opengl32.lib glut32.lib glu32.lib

Rebuild your project and all should be fine!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜