Search code examples
c++c++11cocos2d-x

vs2015 coco2d-x 3.8 error reading characters of string


please see below code: I don't know why this is happenning

bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if (!glview) { 
        **glview = GLViewImpl::createWithRect("NewCocosProject", Rect(0, 0, 960, 640));**
        director->setOpenGLView(glview);
    }
}

bool GLViewImpl::initWithRect(const std::string& viewName, Rect rect, float frameZoomFactor)
{
    setViewName(viewName);
}

below is screenshot

if I continue, I'll get this error: enter image description here

could anyone help?


Solution

  • after 2 weeks struggle, I realized that, I created the coco project with PREBUILD library, then after I change source project it won't affect the library, so I get various funny errors, I download the latest coco studio again, when I create new project, it shows the option: prebuilt or source code, so I create with source code projects, then I can run it successfully.