By the way, gluLookAt (...)
(and GLU in general) is not a part of OpenGL. This is why you will not find documentation directly explaining the cause of this error.
The only reason it generates GL_INVALID_OPERATION
is because behind the scenes it does this: glMultMatrixf (...)
(which was a part of GL once upon a time). That is invalid in a core profile context, because there is no matrix stack anymore; anything that was deprecated in GL 3.0 or 3.1 is removed from GL 3.2 (core profile).
If you need gluLookAt
/ matrix stack functionality on OS X, GLKit provides a suitable collection of replacement utilities. Alternatively, you can use a much more portable (C++ based) library called GLM if you compile using Objective C++.
Now, the far simpler solution here is not to use a core profile context. If you are using things like gluLookAt (...)
you are likely learning legacy OpenGL. You need a context that supports deprecated parts of OpenGL, and on OS X this means you need a 2.1 context.