I’m trying to run some working C++ OpenGL code on the iPhone. So far, I managed to run an Objective-C/OpenGL ES example on the iPhone, and some Objective-C->plain C++ file (“hello world” output to the console).
But I can’t any C++ OpenGL code. The exact problem is including the OpenGL library in the C++ file:
If I use the imports for Objective-C:
#import <UIKit/UIKit.h>
#import <GLKit/GLKit.h>
it will say at all gl* calls “Use of undeclared identifier ‘gl*'”.
If I use the imports I use in only C++:
#include <OpenGL/OpenGL.h>
#include <GLUT/glut.h>
It says OpenGL/OpenGL.h file not found (which I had expected, since OpenGL is full OpenGL library, not OpenGL ES).
So how do I use this C++ file?
Already searched:
http://www.hackint0sh.org/iphone-developer-exchange-9/iphone-sdk-can-i-use-c-opengl-38638.htm
iPhone – OpenGL using C++ tutorial/snippet
But I don’t find how to use the C++ file.
Try:-