I’m not sure if this is the correct place to post, but I’m trying to compile programs on Red Hat 9 using Mesa and glut, but I keep getting complier errors. Here is an example of how I am compiling and the errors I’m getting:
[n0t4h4x0r@DangerMouse glut]# make -f Makefile.linux glut.linux
/usr/bin/cc -o glut.linux glut.o -I/usr/include/GL/ -L/usr/lib/ -lglut -lGLU -lGL
/usr/lib//libglut.a(glut_cindex.o)(.text+0x1a7): In function glutSetColor': : undefined reference to
XStoreColor’
/usr/lib//libglut.a(glut_cindex.o)(.text+0x200): In function glutSetColor': : undefined reference to
XSetWindowColormap’
/usr/lib//libglut.a(glut_cindex.o)(.text+0x39a): In function glutSetColor': : undefined reference to
XStoreColor’
/usr/lib//libglut.a(glut_cindex.o)(.text+0x510): In function glutCopyColormap': : undefined reference to
XSetWindowColormap’
/usr/lib//libglut.a(glut_cindex.o)(.text+0x640): In function glutCopyColormap': : undefined reference to
XStoreColor’
/usr/lib//libglut.a(glut_cmap.o)(.text+0xc8): In function __glutAssociateNewColormap': : undefined reference to
XCreateColormap’
/usr/lib//libglut.a(glut_cmap.o)(.text+0xe8): In function __glutAssociateNewColormap': : undefined reference to
XCreateColormap’
/usr/lib//libglut.a(glut_cmap.o)(.text+0x10a): In function __glutAssociateNewColormap': : undefined reference to
XAllocColorCells’
Here is what my make file looks like:
.SUFFIXES: .c .cpp .c++
TARGET1 = hello.linux
SRC1 = hello.c
TARGET2 = glut.linux
SRC2 = glut.c
TARGET3 = glutrgb.linux
SRC3 = glutrgb.c
LN = ln -s
MV = mv
RM = -rm -rf
CC = /usr/bin/cc
INCLUDES = -I/usr/include/GL/
LOCAL_LIBS =
LD_LIBS = -L/usr/lib/ -lglut -lGLU -lGL
OBJ1 = $(SRC1:.c=.o)
OBJ2 = $(SRC2:.c=.o)
OBJ3 = $(SRC3:.c=.o)
OBJS = $(OBJ1) $(OBJ2) $(OBJ3)
TARGETS = $(TARGET1) $(TARGET2) $(TARGET3)
.c.o:
($(CC) -c $(CFLAGS) $(INCLUDES) $<)
.cpp.o:
($(CC) -c $(CFLAGS) $(INCLUDES) $<)
$(TARGET1): $(OBJ1)
$(CC) $(CFLAGS) -o $@ $(OBJ1) -lm
$(TARGET2): $(OBJ2)
$(CC) $(CFLAGS) -o $@ $(OBJ2) $(INCLUDES) $(LOCAL_LIBS) $(LD_LIBS)
$(TARGET3): $(OBJ3)
$(CC) $(CFLAGS) -o $@ $(OBJ3) $(INCLUDES) $(LOCAL_LIBS) $(LD_LIBS)
all : $(TARGET1) $(TARGET2) $(TARGET3)
default : $(all)
clean:
-$(RM) $(OBJS) $(TARGETS) *~
depend:
makedepend -f Makefile.linux $(SRCS)
Any help or direction would be greatly appreciated.