C++ vs2015 coco2d-x 3.8读取字符串字符时出错
请看下面的代码:我不知道为什么会发生这种情况C++ vs2015 coco2d-x 3.8读取字符串字符时出错,c++,c++11,cocos2d-x,C++,C++11,Cocos2d X,请看下面的代码:我不知道为什么会发生这种情况 bool AppDelegate::applicationDidFinishLaunching() { // initialize director auto director = Director::getInstance(); auto glview = director->getOpenGLView(); if (!glview) { **glview = GLViewImpl::createWi
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));
^^^^^^^^^
我承认,我在这里猜测,但可能对您有用。请您在传递之前创建一个单独的字符串对象:
const & tmpString = std::string("NewCocosProject");
glview = GLViewImpl::createWithRect(tmpString, Rect(0, 0, 960, 640));
^^^^^^^^^
我承认,我在这里猜测,但可能对你有用。经过两周的努力,我意识到,我用预构建库创建了coco项目,然后在我更改源项目后,它不会影响库,所以我会遇到各种有趣的错误,我再次下载最新的coco studio,当我创建新项目时,它显示了选项:预构建或源代码,因此我使用源代码项目创建,然后我可以成功地运行它。经过两周的努力,我意识到,我使用预构建库创建了coco项目,然后在我更改源项目后,它不会影响库,因此我遇到各种有趣的错误,我再次下载了最新的coco studio,当我创建新项目时,它显示选项:预构建或源代码,因此我使用源代码项目创建,然后我可以成功运行它