Setting up OpenGL via terminal on MacOSx 10.5

hey all i just got a new macbook pro, 10.5 and would like to port of my linux c++ opengl applications over to the mac. just to make things simple port just an opengl application that just opens a window.

do the glut libraries already come on the system or do i have to get them somehow from somewhere? i found the normal glu and gl.h files in /usr/include. what do i need to change or include in a makefile?

any readings on this anywhere? i appreciate it in advance…

well i got it to work. the library for glut that you include comes from the framework. here is a copy of my Makefile.

i hope that this will be useful for someone.

INC = -I./usr/include/ -I./usr/X11/include/
LIB = -L/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ -framework OpenGL -framework GLUT
CPP = g++
CPP_OPTS = -g -Wall

opengltest: main.o
@echo ‘>> Linking $@’
$(CPP) -o opengltest $^ $(LIB)
@echo

main.o: main.cpp
@echo ‘++ Building $@’
$(CPP) $(CPP_OPTS) -c main.cpp $(INC)
@echo

clean:
@echo ‘-- Removing temporary files’
rm -f *. opengltest
@echo

From the previous thread:

Forget everything you know about X11.

gcc main.c -framework OpenGL -framework GLUT

and change
#include <GL/glut.h>
#include <GL/gl.h>
to
#include <GLUT/glut.h>
#include <OpenGL/gl.h>

In order to keep your code the same I think that you can make a sub directory in /System/Library/Frameworks/OpenGL.framework/Headers/GL then make symlinks of the header files to that.

You shouldn’t modify /System-- treat it as read-only.

yes it is weird that although i have gl.h and glu.h in /usr/X11/include/GL, in my makefile i have -I./usr/X11/include/.

then in my main program i have #include <GL/gl.h> it says that the folder does not exist. so i am wondering what good it does to even have the include references in the makefile?

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.