linker isn't recognizing gl.h functions

Started by
2 comments, last by cyn0n 21 years, 6 months ago
greets- I''ve tried compiling all of the http://nehe.gamedev.net tuts that have sdl and/or glx support and I always get linker errors that start out like: /tmp/ccCXeskK.o: In function `resizGLScene'': /tmp/ccCXeskK.o(.text+0x20): undefined reference to `glViewport'' I''m running Debian Linux with a 2.4.19 kernel and the latest drivers (glx and kernel module) from nvidia. I''m pretty sure I have all the packages I need. Why isn''t this compiling? My gl sources are in the right place. /usr/include/GL/* -cyn0n
Advertisement
Are you actually linking to the opengl lib?
quote:Original post by cyn0n
/tmp/ccCXeskK.o: In function `resizGLScene'':
/tmp/ccCXeskK.o(.text+0x20): undefined reference to `glViewport''

gcc <sourcefiles> -I <include paths> -L <library paths> -lgl -lglu etc 
greets-
I added -I/usr/include/GL to my makefile and it didn''t help. This is what it looks like now:

CC = gcc -Wall -pedantic -ansi

all:
$(CC) lesson05.c -o lesson05 -I/usr/include/GL -L/usr/X11R6/lib -lGL -lGLU -lXxf86vm

clean:
@echo Cleaning up...
@rm lesson05
@echo Done.

This topic is closed to new replies.

Advertisement