Please help me sir.. its my first .. how to instal OpenGL Library into MinGW ....
i have tried but error
code :
#include <GL/gl.h>
#include <GL/glut.h>
void display() {
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
int main(int argc, char **argv) {
glutInit(&argc, argv);
glutInitWindowSize(512,512);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutCreateWindow("Test Program :: hello world");
glutDisplayFunc(display);
glClearColor(0.0, 0.0, 0.0, 1.0);
glutMainLoop(); // Infinite event loop
return 0;
}
error :
--------------------Configuration: openGL - Debug--------------------
Compiling source file(s)...
belajar1.cpp
belajar1.cpp:17:3: warning: no newline at end of file
Linking...
C:\MinGWStudio\openGL\Debug\belajar1.o: In function glutInit_ATEXIT_HACK': C:\MinGWStudio\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\GL\glut.h:495: undefined reference to
__glutInitWithExit@12'
C:\MinGWStudio\openGL\Debug\belajar1.o: In function glutCreateWindow_ATEXIT_HACK': C:\MinGWStudio\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\GL\glut.h:512: undefined reference to
__glutCreateWindowWithExit@8'
C:\MinGWStudio\openGL\Debug\belajar1.o: In function glutCreateMenu_ATEXIT_HACK': C:\MinGWStudio\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\GL\glut.h:558: undefined reference to
__glutCreateMenuWithExit@8'
C:\MinGWStudio\openGL\Debug\belajar1.o: In function Z7displayv': C:\MinGWStudio\openGL\belajar1.cpp:5: undefined reference to
glClear@4'
C:\MinGWStudio\openGL\belajar1.cpp:6: undefined reference to glFlush@0' C:\MinGWStudio\openGL\Debug\belajar1.o: In function
main':
C:\MinGWStudio\openGL\belajar1.cpp:10: undefined reference to glutInitWindowSize@8' C:\MinGWStudio\openGL\belajar1.cpp:11: undefined reference to
glutInitDisplayMode@4'
C:\MinGWStudio\openGL\belajar1.cpp:13: undefined reference to glutDisplayFunc@4' C:\MinGWStudio\openGL\belajar1.cpp:14: undefined reference to
glClearColor@16'
C:\MinGWStudio\openGL\belajar1.cpp:15: undefined reference to `glutMainLoop@0'
collect2: ld returned 1 exit status
openGL.exe - 10 error(s), 1 warning(s)