need help with setting up GLUT/OpenGL on

skd_aitpune

Registered
Hi,

I have started doing graphics programs on mac, when I tried to compile a sample hello code it was giving error for not able to load glut library. i downloaded the library and placed it in the lib folder. After that it compiles fine but gives the following error when I try to execute it:

dyld: Library not loaded: /usr/X11/lib/libglut.3.dylib
Referenced from: /Users/sandeep/Documents/graphics/./hello
Reason: image not found
Trace/BPT trap

The make file I am using is :

## Makefile for mac

INCLUDE = I/Developer/SDKs/MacOSX10.5.sdk/usr/X11/include
LIBDIR = -L/Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib

CC = g++
CCFLAGS =

OBJFILES = hello.o

LDLIBS = -lX11 -lXi -lXmu -lglut -lGL -lGLU -lm

hello : $(OBJFILES)
$(CC) $(CCFLAGS) -o $@ $(LIBDIR) $(OBJFILES) $(LDLIBS)

hello.o : hello.cpp
$(CC) $(CCFLAGS) -c hello.cpp -I$(INCLUDE)

I would appreciate any help. thanks in advance
 
Back
Top