开发何必难为开发,希望您可以点击一下文章头部或尾部的广告支持我一下~ (~ ̄▽ ̄)~ 点击查看详情

东东

VENT_COME_TO_FOREGROUND' was not declared in this scope
在接uc得sdk时,运行demo,导入到Eclipse中编译时出现错误.百度下有下面的类似问题回答jni/hell...
扫描右侧二维码阅读全文
27
2015/02

VENT_COME_TO_FOREGROUND' was not declared in this scope

在接uc得sdk时,运行demo,导入到Eclipse中编译时出现错误.

百度下有下面的类似问题回答

jni/hellocpp/main.cpp: In function 'void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv*, jobject, jint, jint)':
jni/hellocpp/main.cpp:39:76: error: 'EVENT_COME_TO_FOREGROUND' was not declared in this scope

make: *** [obj/local/armeabi/objs/cocos2dcpp_shared/hellocpp/main.o] Error 1

最后解决方案是找到报错的位置

在这段代码中


 CCShaderCache::sharedShaderCache()->reloadDefaultShaders();
        CCTextureCache::reloadAllTextures();
        CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
        CCDirector::sharedDirector()->setGLDefaultValues(); 


EVENT_COME_TO_FOREGROUND改成EVNET_COME_TO_FOREGROUND
而在cocos2.2.4版本中


则是刚好相反的错误,这时需要把EVNET_COME_TO_FOREGROUND改成EVENT_COME_TO_FOREGROUND

这样就可以解决了,很蛋疼

Last modification:January 1st, 1970 at 08:00 am
您可以点击广告或者直接打赏来支持我
微信公众号

Leave a Comment