#include <GL/glext.h> requires that <GL/gl.h> be included first, as it defines the typedefs for the symbols that are undefined above.

Alternatively, you could try including <cuda_gl_interop.h>...