Skip to content

Instantly share code, notes, and snippets.

@zzNuAzz
Created September 20, 2020 06:09
Show Gist options
  • Save zzNuAzz/01de52743f4dc074c6f90d6a53233ef8 to your computer and use it in GitHub Desktop.
Save zzNuAzz/01de52743f4dc074c6f90d6a53233ef8 to your computer and use it in GitHub Desktop.
Compile OpenGL apps on Mac OS X

Make the following changes

GLUT

Before:

#include <GL/glut.h>

After:

#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif

OpenGL

Before:

#include <GL/gl.h>

After:

#ifdef __APPLE__
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif

Compile

gcc -o ex1 ex1.c -framework GLUT -framework OpenGL -Wno-deprecated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment