PDA

View Full Version : openGL with gcc



08-20-2001, 12:13 PM
I get these errors when I try: gcc test.c -lopengl32 -lglu32:

D:\prog>gcc newgl.c -lopengl32 -lglu32
C:\TEMP\cc0001681.o(.text+0xd9):newgl.c: undefined reference to `glutInit@8'
C:\TEMP\cc0001681.o(.text+0xe0):newgl.c: undefined reference to `glutInitDisplay
Mode@4'
C:\TEMP\cc0001681.o(.text+0xef):newgl.c: undefined reference to `glutInitWindowS
ize@8'
C:\TEMP\cc0001681.o(.text+0xf9):newgl.c: undefined reference to `glutCreateWindo
w@4'
C:\TEMP\cc0001681.o(.text+0x108):newgl.c: undefined reference to `glutDisplayFun
c@4'
C:\TEMP\cc0001681.o(.text+0x10d):newgl.c: undefined reference to `glutMainLoop@0
'

I'm using gcc on nt. Thanks if anyone knows what I have done wrong here.

08-20-2001, 12:19 PM
Sorry, of course the name of the file is "newgl.c"

Zen0
08-21-2001, 09:35 PM
you also need to link in the glut library.
gcc ... -lglut32 should do it.

After that, since you are on NT, the compiler will propably complain other missing symblos related to windows dlls. Use gcc -mwindows to have the standard libs linked in and add -mno-cygwin to get your app running outside the cygwin environment.