I had read a book named "iPhone 3D programming" ,it used a c++ sample code
#include <stdlib.h>
#ifndef HelloArrow_IRenderingEngine_hpp
#define HelloArrow_IRenderingEngine_hpp
enum DeviceOrientation
{
    DeviceOrientationUnknown,
    DeviceOrientationPortrait,
    DeviceOrientationPortraitUpsideDown,
    DeviceOrientationLandscapeLeft,
    DeviceOrientationLandscapeRight,
    DeviceOrientationFaceUp,
    DeviceOrientationFaceDown
};
//Creates an instance of the renderer and sets up various OpenGL state.
struct IRenderingEngine * CreateRender1();
//Interface to the OpenGL ES renderer;consumed by GLView.
struct IRenderingEngine
{
    virtual void Initialize(int width,int height)=0;
    virtual void Render() const=0;
    virtual void UpdateAnimation(float timeStep)=0;
    virtual void OnRotate(DeviceOrientation newOrientaion)=0;
    virtual ~IRenderingEngine(){}
};
#endif
When I compiled this code in Xcode 4.2.1(OS X Lion 10.7.3),it reported that 
IRenderingEngine.hpp: error: unknown type name 'virtual' .
I had created a empty application project which included this sample code.And I 
had renamed all *.m file into *.mm.For example,renamed AppDelegate.m into 
AppDelegate.mm, renamed GLView.m into GLView.mm,but remain  *.hpp file and 
*.cpp file.But it doesn't work for me.Any suggestions will be appreciated.
                                        stevens
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to