升级xcode7,全部2.2.6的项目在mac下编译运行报错

之前都很好,在我把macox系统升级到10.11,xcode升级到xcode7之后

2.2.6的mac项目编译通过之后,运行报错,ios项目可以正常运行,错误如下:

 libc++abi.dylib: terminating with uncaught exception of type std::logic_error: basic_string::_S_construct NULL not valid

打印定位错误,可知道,错误出现在 pDirector->setOpenGLView(pEGLView); 中,十分困惑,求高人帮助!!!!

bool AppDelegate::applicationDidFinishLaunching() {

// initialize director

CCDirector* pDirector = CCDirector::sharedDirector();

CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();

pDirector->setOpenGLView(pEGLView);

。。。。。。

继续追项目,发现CCConfiguration 类下m_pValueDict->setObject( CCString::create( (const char*)glGetString(GL_VENDOR)), “gl.vendor”);中(const char*)glGetString(GL_VENDOR)的值是null的。
貌似opengl没有初始化引起的,是否是升级了macox以及xcode7让项目配置出现了什么问题呢?

求同样升级了系统的小伙伴,谁能帮忙解决下

顶一下,求解决,重装系统很麻烦……

:sweat:,2.2.6好老了,现在都3.8.1了,官方在3.8.1中解决了xcode7编译报错的问题:12:

2.x 升级 3.x 干不起,改动太多了。

问题已经解决。

不是升级xcode7的问题,是升级mac ox 10.11引起的问题。

之前还有些老的游戏是2.x的,新游戏3.x的是没问题的。
在 applicationDidFinishLaunching中进行添加
//mac ox10.11升级系统后出现问题,
//方案一:
NSOpenGLContext *ctx = initWithFormat:pixelFormat shareContext:nil];
if(ctx)
{
;
;
;
}

    //方案二:
    ;