What files are these functions in?

I’m not advanced, in fact I’m just starting, but I thought there was a better chance of someone here being able to figure out what’s going on. Here’s what’s up. I got everything installed correctly and I have an example program that include’s glut.h. I gave the compiler the opengl32 and glut32 libraries to link in, but when I try to compile it just gives me this.

gcc: -lopengl32: linker input file unused since linking not done
gcc: -lglut32: linker input file unused since linking not done

and the linker gives me this huge honkin’ list of errors:

c:/my documents/accum.o: In function Init': //c/dev-c++/examples/opengl/accum.c:14: undefined reference to _imp__glClearColor’
//c/dev-c++/examples/opengl/accum.c:15: undefined reference to _imp__glClearAccum' //c/dev-c++/examples/opengl/accum.c:17: undefined reference to _imp__glGenLists’
//c/dev-c++/examples/opengl/accum.c:18: undefined reference to _imp__glNewList' //c/dev-c++/examples/opengl/accum.c:19: undefined reference to _imp__glColor3f’
//c/dev-c++/examples/opengl/accum.c:20: undefined reference to _imp__glRectf' //c/dev-c++/examples/opengl/accum.c:21: undefined reference to _imp__glEndList’
//c/dev-c++/examples/opengl/accum.c:23: undefined reference to _imp__glGenLists' //c/dev-c++/examples/opengl/accum.c:24: undefined reference to _imp__glNewList’
//c/dev-c++/examples/opengl/accum.c:25: undefined reference to _imp__glColor3f' //c/dev-c++/examples/opengl/accum.c:26: undefined reference to _imp__glRectf’
//c/dev-c++/examples/opengl/accum.c:27: undefined reference to _imp__glEndList' c:/my documents/accum.o: In function main’:
//c/dev-c++/examples/opengl/accum.c:103: undefined reference to glutInit' //c/dev-c++/examples/opengl/accum.c:108: undefined reference to glutInitDisplayMode’
//c/dev-c++/examples/opengl/accum.c:109: undefined reference to glutInitWindowSize' //c/dev-c++/examples/opengl/accum.c:110: undefined reference to glutCreateWindow’
//c/dev-c++/examples/opengl/accum.c:114: undefined reference to glutReshapeFunc' //c/dev-c++/examples/opengl/accum.c:115: undefined reference to glutKeyboardFunc’
//c/dev-c++/examples/opengl/accum.c:116: undefined reference to glutDisplayFunc' //c/dev-c++/examples/opengl/accum.c:117: undefined reference to glutMainLoop’
c:/my documents/accum.o: In function Reshape': //c/dev-c++/examples/opengl/accum.c:33: undefined reference to _imp__glViewport’
//c/dev-c++/examples/opengl/accum.c:35: undefined reference to _imp__glMatrixMode' //c/dev-c++/examples/opengl/accum.c:36: undefined reference to _imp__glLoadIdentity’
//c/dev-c++/examples/opengl/accum.c:37: undefined reference to _imp__glMatrixMode' //c/dev-c++/examples/opengl/accum.c:38: undefined reference to _imp__glLoadIdentity’
c:/my documents/accum.o: In function Key': //c/dev-c++/examples/opengl/accum.c:50: undefined reference to _imp__glPolygonMode’
//c/dev-c++/examples/opengl/accum.c:51: undefined reference to glutPostRedisplay' c:/my documents/accum.o: In function Draw’:
//c/dev-c++/examples/opengl/accum.c:61: undefined reference to _imp__glPushMatrix' //c/dev-c++/examples/opengl/accum.c:63: undefined reference to _imp__glScalef’
//c/dev-c++/examples/opengl/accum.c:65: undefined reference to _imp__glClear' //c/dev-c++/examples/opengl/accum.c:66: undefined reference to _imp__glCallList’
//c/dev-c++/examples/opengl/accum.c:67: undefined reference to _imp__glAccum' //c/dev-c++/examples/opengl/accum.c:69: undefined reference to _imp__glClear’
//c/dev-c++/examples/opengl/accum.c:70: undefined reference to _imp__glCallList' //c/dev-c++/examples/opengl/accum.c:71: undefined reference to _imp__glAccum’
//c/dev-c++/examples/opengl/accum.c:73: undefined reference to _imp__glAccum' //c/dev-c++/examples/opengl/accum.c:75: undefined reference to _imp__glPopMatrix’
//c/dev-c++/examples/opengl/accum.c:78: undefined reference to glutSwapBuffers' //c/dev-c++/examples/opengl/accum.c:80: undefined reference to _imp__glFlush’

Could someone please tell me what it’s looking for and what to do to fix it.

Well those functions ARE from the opengl32 and glut32 libraries…so if you can fix the library linking error, you will fix the undefine-reference errors

I am not too familiar with gcc, but if you can find out where the libraries are, you might have more success moving them somewhere that the compiler might find easier…

Alright, I read around found out (I think) why this was happening. I was compiling in windows, and didn’t have windows.h included above the gl stuff. Anyways, now that I got rid of those errors I’ve got some more interesting stuff going on… somebody please give it a shot.

C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .idata$5’
C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .text' C:\DEV-C_~1\BIN\ld.exe: C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll): warning: ignoring duplicate section .idata$5’
C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll)(.idata$2+0x0): multiple definition of idata$2' C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll)(.debug$S+0x0): first defined here C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll)(.idata$2+0x0): multiple definition of idata$4’
C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll)(.debug$S+0x0): first defined here
C:/DEV-C_~1/LIB/\libglut32.a(glut32.dll)(.idata$2+0x0): multiple definition of `idata$5’
C:/DEV-C_~1/LIB/\libopengl32.a(OPENGL32.dll)(.debug$S+0x0): first defined here

Now, it appears to me that in the two libraries (opengl32, and glut32) there’s a bunch of stuff repeated, but I’ve got no clue as to how to fix it. If I leave one out there’s a bunch of undefined references. Thanx for the patience guys.

dont include windows.h if you are using glut
instead include glut.h

now with gcc (and i am no expert or user) I think you compile like this

gcc -lgl -lglu -lglut and your file

and I also think you may want to use sgis files (are the lib files compatible with gcc?) anyone (opengl32.lib is made by Microsoft and it may not work with anything but vc++ ? I am also not sure about this, but if you are using glut do NOT include windows.h