2013-05-09 34 views
15

它不能編譯源代碼,並寫道:iOS。更新此項目中的cocos2d庫後無法運行項目

Undefined symbols for architecture i386:
"_CTFontManagerRegisterFontsForURL", referenced from: -[CCLabelTTF getFontName:] in CCLabelTTF.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

但是當我更換所有的代碼在以下功能CCLabelTTF與「迴歸零」:

- (NSString*) getFontName:(NSString*)fontName 
{ 
    // Custom .ttf file ? 
    if ([[fontName lowercaseString] hasSuffix:@".ttf"]) 
    { 
     // This is a file, register font with font manager 
     NSString* fontFile = [[CCFileUtils sharedFileUtils] fullPathForFilename:fontName]; 
     NSURL* fontURL = [NSURL fileURLWithPath:fontFile]; 
     CTFontManagerRegisterFontsForURL((CFURLRef)fontURL, kCTFontManagerScopeProcess, NULL); 

     return [[fontFile lastPathComponent] stringByDeletingPathExtension]; 
    } 

    return fontName; 
} 

然後我可以編譯我的代碼,但我不能使用標籤。

那麼如何在不創建新項目的情況下解決此問題並將所有源複製到它?

EDITED

以前的版本2.X,現在我有最後的RC2版本。

我刪除了舊庫的所有文件,將文件從新庫複製到項目文件夾中,並通過xcode將它們添加到項目中。 xcode可以用新的庫文件創建項目,所以我從這個新項目中拿走了它們。然後我做了一些更改以刪除警告。

+0

你是怎麼進行升級?從哪個版本到哪個vrsion? – LearnCocos2D 2013-05-09 17:49:17

+0

我編輯了我的問題來回答你的問題 – Gargo 2013-05-09 18:25:44

回答

42

解決通過導入CoreText.framework

但我想我會創建一個新的項目,因爲我仍然有一些麻煩與識別的iPhone5屏幕尺寸