segunda-feira, 24 de dezembro de 2012

qMake specs for MakeFiles and Xcode

qmake specs  just to remember

for Makefiles using g++ :

qmake -spec macx-g++

and for Xcode :
qmake -spec macx-xcode

simple MakeFile

most simple Makefile  using g++  and a clean directive using GLUT and OpenGL in OSx



EXEC: \
compile

compile: \
main.cpp
g++ main.cpp -o teste -framework OpenGL -framework GLUT
echo "compiling"

.PHONY: clean

clean:
rm -f teste

domingo, 23 de dezembro de 2012

Glut and OpenGL using Osx

Glut and OpenGL setup  for Osx Lion 10.7.4

Osx Docs instruction is: 
#include <OpenGL/gl.h> 
#include <OpenGL/glu.h>
 #include <GLUT/glut.h>
you don't need to include gl.h and glu.h, as they are already included in glut.h.
and for build and link  Docs instruction is: 
cc -framework GLUT -framework OpenGL -framework Cocoa glutapp.c -o glutapp 
but  I am using g++  we dont need cocoa framework 
so this is how it is working in my case 


#if defined(__APPLE__)
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif

 Build: 

g++ -framework OpenGL -framework GLUT main.cpp -o testeApp