【问题标题】:sharedlibrary apply-load-rules all Warning: the current language does not match this frame. Current language: auto; currently objective-csharedlibrary apply-load-rules all 警告:当前语言与此框架不匹配。当前语言:自动;目前客观-c
【发布时间】:2011-07-15 11:46:23
【问题描述】:

我已将 Cocos2d 集成到我的基于 Windows 的应用程序中。当我运行我的项目时,我在执行 CC_DIRECTOR_INIT(); 行后遇到崩溃错误是 **sharedlibrary **apply-load-rules all 警告:当前语言与此框架不匹配。 当前语言:自动;目前客观-c****。我从这个POST 中找到了错误的含义。但我的问题是如何在我的项目中实现它。我是 cocos2-d 的新手。任何建议表示赞赏。

- (void) applicationDidFinishLaunching:(UIApplication*)application
{
    CC_DIRECTOR_INIT();
    CCDirector *director = [CCDirector sharedDirector];
    [director setDeviceOrientation:kCCDeviceOrientationPortrait];
    [director setDisplayFPS:YES];
    EAGLView *view = [director openGLView];
    [view setMultipleTouchEnabled:YES];
    [CCTexture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA8888];    
    [[CCDirector sharedDirector] runWithScene: [Helloworld scene]];
}

这是发生崩溃的屏幕截图...

编辑: 我的控制台输出..

#0  0x0002e60f in -[CCLabelAtlas updateAtlasValues] (self=0x68224c0, _cmd=0xc0be2) at CCLabelAtlas.m:75
#1  0x0002e994 in -[CCLabelAtlas setString:] (self=0x68224c0, _cmd=0x310f12c, newString=0xf3b98) at CCLabelAtlas.m:113
#2  0x0002e49c in -[CCLabelAtlas initWithString:charMapFile:itemWidth:itemHeight:startCharMap:] (self=0x68224c0, _cmd=0xb8d31, theString=0xf3b98, charmapfile=0xf3b88, w=16, h=24, c=46 '.') at CCLabelAtlas.m:50
#3  0x0002e380 in +[CCLabelAtlas labelAtlasWithString:charMapFile:itemWidth:itemHeight:startCharMap:] (self=0xf1ebc, _cmd=0xb6fd5, string=0xf3b98, charmapfile=0xf3b88, w=16, h=24, c=46 '.') at CCLabelAtlas.m:40
#4  0x0001268a in -[CCDirector setGLDefaultValues] (self=0x681c300, _cmd=0xb6b3d) at CCDirector.m:219
#5  0x0001406d in -[CCDirector setOpenGLView:] (self=0x681c300, _cmd=0xb6a18, view=0x681c850) at CCDirector.m:549
#6  0x00002e58 in -[cocowindowAppDelegate applicationDidFinishLaunching:] (self=0x681abe0, _cmd=0xd050a3, application=0x68016f0) at cocowindowAppDelegate.m:32
#7  0x00912ce2 in -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] ()
#8  0x00914d88 in -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] ()
#9  0x0091f617 in -[UIApplication handleEvent:withNewEvent:] ()
#10 0x00917abf in -[UIApplication sendEvent:] ()
#11 0x0091cf2e in _UIApplicationHandleEvent ()
#12 0x02e61992 in PurpleEventCallback ()
#13 0x01403944 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#14 0x01363cf7 in __CFRunLoopDoSource1 ()
#15 0x01360f83 in __CFRunLoopRun ()
#16 0x01360840 in CFRunLoopRunSpecific ()
#17 0x01360761 in CFRunLoopRunInMode ()
#18 0x009147d2 in -[UIApplication _run] ()
#19 0x00920c93 in UIApplicationMain ()
#20 0x00002b39 in main (argc=1, argv=0xbfffeff0) at main.m:14
(gdb) 

【问题讨论】:

标签: iphone objective-c cocos2d-iphone


【解决方案1】:

EXC_ARITHMETIC 通常意味着你除以零。如果您查看屏幕截图,那么您正在评估:

int row = (a % itemsPerRow) //...

从您的调试器的输出来看,itemsPerRow 是 0,此时程序正在崩溃。尝试初始化此值或设置一些条件代码(如果它是零)以阻止它被零除。

警告消息Warning: the current language does not match this frame. 只是 GDB 对调试的语言有点困惑。如您所见,它设法在下一行对自己进行排序。

编辑:

此海报与您有类似的错误:http://www.cocos2d-iphone.org/forum/topic/8209 他的修复适用于您吗?

【讨论】:

  • @Kattu 我现在来看看,但它看起来应该是在调用此方法之前应该设置的值。这可能是由 setter 或类的构造函数实现的。
  • 我都检查过了。 CC_DIRECTOR_INIT();是第一个执行的方法。
  • 我快速浏览了 Cocos2d 的源代码,看起来崩溃的代码自您使用的版本以来已经更新了一些。您使用的是什么版本,是否可以更新?
  • 这个类似的解决方案对您有帮助吗? cocos2d-iphone.org/forum/topic/8209
猜你喜欢
  • 2011-08-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-10-07
  • 2021-12-10
  • 1970-01-01
  • 1970-01-01
  • 2020-09-26
相关资源
最近更新 更多