Hello,
I am using Minw32 GCC (Dev-CPP) to compile OpenGL programs. Somebody in the newsgroup said that -lgl option would be required to compile with OpenGL library…
I need help regarding this… LibGL file for Windows … where to get them :mad: :eek:
Hello,
I am using Minw32 GCC (Dev-CPP) to compile OpenGL programs. Somebody in the newsgroup said that -lgl option would be required to compile with OpenGL library…
I need help regarding this… LibGL file for Windows … where to get them :mad: :eek:
On windows, it should be -lopengl32 instead of -lGL.
Help this the code and it is not working
#include <windows.h>
#include <GL\glut.h>
void init()
{
glClearColor(1,0,0,1);
glOrtho(0,1,0,1,0,1);
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB|GLUT_SINGLE);
glutInitWindowSize(800,600);
glutInitWindowPosition(5,20);
glutCreateWindow(“Tutorial 1”);
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
The error messages given by the compiler are as follows:
g++.exe “D:\shudh\ccodes\ogl_vertex_data\ogl_vertex_data est.cpp” -o “D:\shudh\ccodes\ogl_vertex_data\ogl_vertex_data est.exe” -I"C:\apps\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\apps\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\apps\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\apps\Dev-Cpp\include\c++\3.4.2" -I"C:\apps\Dev-Cpp\include" -L"C:\apps\Dev-Cpp\lib" -lglu32 -lopengl32 -lglut -mwindows
C:\DOCUME~1\SUDDHA~1\LOCALS~1\Temp/cce6aaaa.o(.text+0xb2):test.cpp: undefined reference to glutInit' C:\DOCUME~1\SUDDHA~1\LOCALS~1\Temp/cce6aaaa.o(.text+0xbe):test.cpp: undefined reference to
glutInitDisplayMode’
C:\DOCUME~1\SUDDHA~1\LOCALS~1\Temp/cce6aaaa.o(.text+0xd2):test.cpp: undefined reference to glutInitWindowSize' C:\DOCUME~1\SUDDHA~1\LOCALS~1\Temp/cce6aaaa.o(.text+0xe6):test.cpp: undefined reference to
glutInitWindowPosition’
C:\DOCUME~1\SUDDHA~1\LOCALS~1\Temp/cce6aaaa.o(.text+0xf2):test.cpp: undefined reference to glutCreateWindow' C:\DOCUME~1\SUDDHA~1\LOCALS~1\Temp/cce6aaaa.o(.text+0x103):test.cpp: undefined reference to
glutDisplayFunc’
C:\DOCUME~1\SUDDHA~1\LOCALS~1\Temp/cce6aaaa.o(.text+0x108):test.cpp: undefined reference to `glutMainLoop’
collect2: ld returned 1 exit status
Execution terminated
Hmm…
Normally I’d say you have forgotten -lglut, but you haven’t :rolleyes:
Make sure the glut library is installed on your system (glut.a + glut.dll), and make sure it is not broken… Also I’m not really sure, it’s a long time since I last developed on windows, but could it be that this is called glut32, too?
Glut32.dll exists in the system directory and the system32 directory as well.
Now the new errors are there … please see the compile log
Compiler: Default compiler
Executing g++.exe…
g++.exe “D:\shudh\ccodes\ogl_vertex_data\ogl_vertex_data est.cpp” -o “D:\shudh\ccodes\ogl_vertex_data\ogl_vertex_data est.exe” -I"C:\apps\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\apps\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\apps\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\apps\Dev-Cpp\include\c++\3.4.2" -I"C:\apps\Dev-Cpp\include" -L"C:\apps\Dev-Cpp\lib" -lglu32 -lopengl32 -lglut -lglut32 -mwindows
C:\apps\Dev-Cpp\lib/libglut32.a(glut_event.o)(.text+0x319):glut_event.c: undefined reference to glFinish@0' C:\apps\Dev-Cpp\lib/libglut32.a(glut_event.o)(.text+0x374):glut_event.c: undefined reference to
wglSwapBuffers@4’
C:\apps\Dev-Cpp\lib/libglut32.a(glut_event.o)(.text+0x3dc):glut_event.c: undefined reference to wglSwapBuffers@4' C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x18f):glut_win.c: undefined reference to
wglGetCurrentContext@0’
C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x196):glut_win.c: undefined reference to wglGetCurrentDC@0' C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x1b6):glut_win.c: undefined reference to
wglMakeCurrent@8’
C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x1d5):glut_win.c: undefined reference to glViewport@16' C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x1f7):glut_win.c: undefined reference to
wglMakeCurrent@8’
C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x216):glut_win.c: undefined reference to glViewport@16' C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x21e):glut_win.c: undefined reference to
wglGetCurrentContext@0’
C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x225):glut_win.c: undefined reference to wglGetCurrentDC@0' C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x241):glut_win.c: undefined reference to
wglMakeCurrent@8’
C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x843):glut_win.c: undefined reference to wglGetCurrentContext@0' C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x84a):glut_win.c: undefined reference to
wglGetCurrentDC@0’
C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x866):glut_win.c: undefined reference to wglMakeCurrent@8' C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x897):glut_win.c: undefined reference to
glDrawBuffer@4’
C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0x8a6):glut_win.c: undefined reference to glReadBuffer@4' C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0xaa1):glut_win.c: undefined reference to
wglDeleteContext@4’
C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0xb61):glut_win.c: undefined reference to wglMakeCurrent@8' C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0xbd2):glut_win.c: undefined reference to
wglGetCurrentContext@0’
C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0xbd9):glut_win.c: undefined reference to wglGetCurrentDC@0' C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0xbf5):glut_win.c: undefined reference to
wglMakeCurrent@8’
C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0xcb4):glut_win.c: undefined reference to wglGetCurrentContext@0' C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0xcbb):glut_win.c: undefined reference to
wglGetCurrentDC@0’
C:\apps\Dev-Cpp\lib/libglut32.a(glut_win.o)(.text+0xcd7):glut_win.c: undefined reference to wglMakeCurrent@8' C:\apps\Dev-Cpp\lib/libglut32.a(glut_mesa.o)(.text+0x80):glut_mesa.c: undefined reference to
glGetString@4’
C:\apps\Dev-Cpp\lib/libglut32.a(glut_mesa.o)(.text+0x91):glut_mesa.c: undefined reference to `glGetString@4’
C:\apps\Dev-Cpp\lib/libglut32.a(glut_util.o)(.text+0x281):glut_util.c: undefined reference to glGetError@0' C:\apps\Dev-Cpp\lib/libglut32.a(glut_util.o)(.text+0x28d):glut_util.c: undefined reference to
gluErrorString@4’
C:\apps\Dev-Cpp\lib/libglut32.a(win32_glx.o)(.text+0x30d):win32_glx.c: undefined reference to wglCreateContext@4' C:\apps\Dev-Cpp\lib/libglut32.a(glut_swap.o)(.text+0x71):glut_swap.c: undefined reference to
wglSwapBuffers@4’
C:\apps\Dev-Cpp\lib/libglut32.a(win32_winproc.o)(.text+0x292):win32_winproc.c: undefined reference to joyReleaseCapture@4' C:\apps\Dev-Cpp\lib/libglut32.a(win32_winproc.o)(.text+0x3fc):win32_winproc.c: undefined reference to
joySetCapture@16’
C:\apps\Dev-Cpp\lib/libglut32.a(win32_winproc.o)(.text+0x162f):win32_winproc.c: undefined reference to joyGetPosEx@8' C:\apps\Dev-Cpp\lib/libglut32.a(win32_winproc.o)(.text+0x171f):win32_winproc.c: undefined reference to
joyGetPosEx@8’
collect2: ld returned 1 exit status
Execution terminated