PDA

View Full Version : undefined reference to gl everything



03-23-2000, 01:41 PM
Okay I'm working on my very first "hello world" OGL program and I keep getting compile errors:

>undefined reference to `glClear'
>undefined reference to `glutCreateWindow'

etc.

I've included GL/glut.h; what's my problem?

Nate
03-23-2000, 01:46 PM
Make sure you link to opengl32.lib and glut32.lib.

Nate http://nate.scuzzy.net

03-23-2000, 01:59 PM
Sorry, I should have said, I'm on a FreeBSD machine.

Am I looking for something like
$>gcc hello.c -lGL

How do I check if I have the required files?

03-24-2000, 06:06 AM
Okay, I've found the librarys. They where hiding in the X11R6's lib folder.

But which one do I need to include?

Sjonny
03-24-2000, 12:51 PM
Here's my Makefile:

CCOPS = -c -g -Wall
LINKS = -lglut -lMesaGLU -lMesaGL -lm -lX11 -lXext -lXmu
LDPATH = -L/usr/lib -L/usr/X11R6/lib
INCS = -I. -I/usr/include
OBJS = main.o

.cpp.o :
g++ $(CCOPS) $(INCS) $<

all: main

main: $(OBJS)
g++ $(OBJS) $(INCS) $(LDPATH) $(LINKS) -o $@

clean:
rm -f main *.o core