2011-07-15 53 views
1

我有集成的Cocos2d到我的基於Windows的應用程序。當我運行我的項目時,我正在執行該行後出現崩潰CC_DIRECTOR_INIT();錯誤是** sharedlibrary ** apply-load-rules全部 警告:當前語言與此框架不匹配。 當前語言:汽車;目前是objective-c ****。我發現這個錯誤形式的含義是POST。但我的問題是我如何在我的項目中實現這一點。我是cocos2-d的新手。任何建議表示讚賞。sharedlibrary apply-load-rules all警告:當前語言與此框架不匹配。當前語言:auto;目前objective-c

- (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]]; 
} 

這就是發生崩潰的截圖... This is the screenshot of where the crash occurs.

編輯: 我的控制檯輸出..

#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) 
+0

朋友我從這個鏈接找到了這個問題的答案..http://www.cocos2d-iphone.org/forum/topic/8209 ...感謝xoebus :) – Aravindhan

回答

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請問他的修復適用於你?

+0

:但是這段代碼是cocos2d庫。我該如何修改? – Aravindhan

+0

@Kattu我現在看看,但它看起來像應該在調用此方法之前設置的值。這可能是由setter或類的構造函數。 – xoebus

+0

我檢查了所有。 CC_DIRECTOR_INIT();是第一個執行的方法。 – Aravindhan