View Single Post
  #1   (View Single Post)  
Old 11th January 2009
welkin welkin is offline
Port Guard
 
Join Date: May 2008
Posts: 21
Default Trying to compile GLUT source code on freebsd.

Hello folks

I`m trying to compile Psypong3d on my freebsd 7.1 box.
http://psypong3d.sourceforge.net/
It`s a pong clone with nice glut graphics. The code and makefile are simple, but I run into a make error.

First, I installed freeglut.

Second, I added the FreeBSD paths for GL Libs and headers to the make-file.
Then it looks like this:

Code:
CC = gcc
OUT = pp3d

CFLAGS = -g -W -Wall -I/usr/local/include
LIBS = -lglut -lm -L/usr/local/lib

OBJECTS = common.o bmp.o main.o game.o floor.o player.o ball.o camera.o keyboard.o

$(OUT) : $(OBJECTS)
	$(CC) $(CFLAGS) $(OBJECTS) -o $(OUT) $(LIBS)

	@echo -e "\nBuild complete!"
	@echo -e "\nTo run the program type: ./$(OUT)\n"

clean:
	rm -rf *.o
	rm -rf $(OUT)
Third, I started make.

It compiles most part of the code, but I always get an error about main.o

main.o(.text+0xd7): In function `main':
/usr/home/welkin/psypong3d-0.9/src/main.c:38: undefined reference to `on_exit'
gmake: *** [pp3d] Error 1

I`m not very experienced with makefiles, so maybe someone has a idea.
Reply With Quote