Error: class "cocos2d::GLview" has no member "create"

Hi, im trying to import Live2d to cocos, and I’ve been trying to fix some errors upon loading the given vcx project or solution. The version they made it in was cocos 2d-x 3.0, but im using 3.3 beta but I don’t think that is a problem.

Some of the code in AppDelegate.cpp

bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();

if(!glview) {
    glview = GLView::create("Live2D Simple");
    director->setOpenGLView(glview);
}

// turn on display FPS
director->setDisplayStats(true);

// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);

//Live2D
Live2D::init();

// create a scene. it's an autorelease object
auto scene = HelloWorld::createScene();

// run
director->runWithScene(scene);

return true;

}

The error is at:
glview = GLView::create(“Live2D Simple”);

Somehow create is not a function of GLView but I checked at
http://www.cocos2d-x.org/reference/native-cpp/V3.2/de/d4d/classcocos2d_1_1_g_l_view.html

and it is there, any help would be great, thanks!

1 Like

There was some refactoring done in 3.3.

Use:

glview = GLViewImpl::create("Live2D Simple");

You will need to #import "platform/ios/CCEAGLView-ios.h" also, if you are using iOS for example.

Or as some of us call it “breaking backward compatibility”.

Slackmoehrie, I know you hear about this a lot so I’m not even going to bother. Next time you’re in China can you slap the cocos team over the head with a wet fish for me, thanks.

I opened up a “Cocos2d-x Dev Topic” on this subject. Please participate.

LOL, I’ve never been to China! However, I can tell you that sometimes developers make “design mistakes”. :slight_smile:

I opened the topic for this reason…I don’t know enough about why they did this and it does break things.

http://discuss.cocos2d-x.org/t/glview-glviewimpl-change-in-3-3/17408