title: Expected specifier-qualifier-list before... Error in C++/Objective-C iPhone project
body: <p>So I'm going through the first tutorial in O'Reilly's iPhone 3D Programming book. At this point in the tutorial, it pulls all the OpenGL ES stuff into a seperate c++ interface. I have followed the book to the letter, as far as I can tell, yet I can't seem to figure out this compiler error. I'm fairly new to C++ (mostly C# in the past), so I'm sure it's something stupid. </p>
  
  <p>Below is the current state of all the relevant files.</p>
  
  <p>I have a c++ header file called <strong>IRenderingEngine.hpp</strong> with the following contents:</p>
  
  <pre><code>enum DeviceOrientation {
      Unknown,
      Portrait,
      PortraitUpsideDown,
      LandscapeLeft,
      LandscapeRight,
      FaceUp,
      FaceDown,
  };
  
  struct IRenderingEngine* CreateRenderer1();
  
  struct IRenderingEngine {
      virtual void Initialize(int width, int height) = 0; //Compiler error "expected specifier-qualifier-list before 'virtual'
      virtual void Render() const = 0;
      virtual void UpdateAnimation(float timeStep) = 0;
      virtual void OnRotate(DeviceOrientation newOrientation) = 0;
      virtual ~IRenderingEngine() {}
  };
  </code></pre>
  
  <p>I have an objective-c/c++ header file called <strong>GLView.h</strong> that looks like this:</p>
  
  <pre><code>#import "IRenderingEngine.hpp"
  #import &lt;OpenGLES/EAGL.h&gt;
  #import &lt;QuartzCore/QuartzCore.h&gt;
  
  @interface GLView : UIView {
      EAGLContext* m_context;
      IRenderingEngine* m_renderingEngine; //Compiler error: Expected specifier-qualifier-list before "IRenderingEngine"
      float m_timeStamp;
  }
  
  - (void) drawView: (CADisplayLink*) displayLink;
  - (void) didRotate: (NSNotification*) notification;
  
  @end
  </code></pre>
  
  <p>And finally, a <strong>GLView.mm</strong> file with a barebones implementation:</p>
  
  <pre><code>#import "GLView.h"
  
  
  @implementation GLView
  
  + (Class) layerClass
  {
      return [CAEAGLLayer class];
  }
  
  - (id)initWithFrame:(CGRect)frame {
      return self;
  }
  
  - (void) drawView:(CADisplayLink *)displayLink
  {
  
  }
  
  -(void) didRotate:(NSNotification *)notification
  {
  
  }
  
  @end
  </code></pre>