vs2015 coco2d-x 3.8 读取字符串字符错误

vs2015 coco2d-x 3.8 error reading characters of string

请看下面的代码:我不知道为什么会这样

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);
}

如果我继续,我会得到这个错误:

有人能帮忙吗?

能否请您在传递之前创建一个单独的字符串对象:

const & tmpString = std::string("NewCocosProject");
glview = GLViewImpl::createWithRect(tmpString, Rect(0, 0, 960, 640));
                                    ^^^^^^^^^

我承认,我在这里猜测,但可能对你有用。

经过 2 周的努力,我意识到,我用 PREBUILD 库创建了 coco 项目,然后在我更改源项目后它不会影响库,所以我得到了各种有趣的错误,我下载了最新的 coco studio再次,当我创建新项目时,它显示选项:预构建或源代码,所以我使用源代码项目创建,然后我可以 运行 成功。