HI, 大家好
Need your help,我用的是xcode6.1, cocos2d-x 2.2.5. 按照文档中的操作,
http://cn.cocos2d-x.org/article/index?type=cocos2d-x&url=/doc/cocos-docs-master/manual/framework/native/v2/getting-started/setting-up-development-environments/mac-osx-environment-setup/how-to-run-helloworld-of-cocos2d-x-on-iphone-emulator/zh.md
在编译时,出现如下错误:
Undefined symbols for architecture i386:
“std::string::find_last_of(char const*, unsigned long) const”, referenced from:
cocos2d::CCFileUtilsIOS::isFileExist(std::string const&) in libcocos2dx.a(CCFileUtilsIOS.o)
cocos2d::CCFileUtils::getPathForFilename(std::string const&, std::string const&, std::string const&) in libcocos2dx.a(CCFileUtils.o)
cocos2d::CCLabelAtlas::initWithString(char const*, char const*) in libcocos2dx.a(CCLabelAtlas.o)
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(char const*) in libcocos2dx.a(CCSpriteFrameCache.o)
“std::string::copy(char*, unsigned long, unsigned long) const”, referenced from:
cocos2d::CCNotificationObserver::CCNotificationObserver(cocos2d::CCObject*, void (cocos2d::CCObject::)(cocos2d::CCObject), char const*, cocos2d::CCObject*) in libcocos2dx.a(CCNotificationCenter.o)
“std::string::data() const”, referenced from:
llvm::ConvertUTF8toWide(unsigned int, std::string const&, char*&, unsigned char const*&) in libcocos2dx.a(ccUTF8.o)
cocos2d::cc_utf16_to_utf8(unsigned short const*, int*) in libcocos2dx.a(ccUTF8.o)
“std::string::find(char const*, unsigned long) const”, referenced from:
cocos2d::CCBMFontConfiguration::parseInfoArguments(std::string) in libcocos2dx.a(CCLabelBMFont.o)
cocos2d::CCBMFontConfiguration::parseCommonArguments(std::string) in libcocos2dx.a(CCLabelBMFont.o)
cocos2d::CCBMFontConfiguration::parseCharacterDefinition(std::string, cocos2d::_BMFontDef*) in libcocos2dx.a(CCLabelBMFont.o)
cocos2d::CCBMFontConfiguration::parseKerningEntry(std::string) in libcocos2dx.a(CCLabelBMFont.o)
cocos2d::CCTextureCache::addImage(char const*) in libcocos2dx.a(CCTextureCache.o)
cocos2d::computeImageFormatType(std::string&) in libcocos2dx.a(CCTextureCache.o)
cocos2d::CCImage::saveToFile(char const*, bool) in libcocos2dx.a(CCImage.o)
…
“std::string::find(char, unsigned long) const”, referenced from:
cocos2d::CCBMFontConfiguration::parseConfigFile(char const*) in libcocos2dx.a(CCLabelBMFont.o)
cocos2d::CCBMFontConfiguration::parseInfoArguments(std::string) in libcocos2dx.a(CCLabelBMFont.o)
cocos2d::CCBMFontConfiguration::parseCommonArguments(std::string) in libcocos2dx.a(CCLabelBMFont.o)
cocos2d::CCBMFontConfiguration::parseImageFileName(std::string, char const*) in libcocos2dx.a(CCLabelBMFont.o)
cocos2d::CCBMFontConfiguration::parseCharacterDefinition(std::string, cocos2d::_BMFontDef*) in libcocos2dx.a(CCLabelBMFont.o)
cocos2d::CCBMFontConfiguration::parseKerningEntry(std::string) in libcocos2dx.a(CCLabelBMFont.o)
cocos2d::CCRectFromString(char const*) in libcocos2dx.a(CCNS.o)
…
“std::string::size() const”, referenced from:
cocos2d::CCLabelTTF::setHorizontalAlignment(cocos2d::CCTextAlignment) in libcocos2dx.a(CCLabelTTF.o)
cocos2d::CCLabelTTF::setVerticalAlignment(cocos2d::CCVerticalTextAlignment) in libcocos2dx.a(CCLabelTTF.o)
cocos2d::CCLabelTTF::setDimensions(cocos2d::CCSize const&) in libcocos2dx.a(CCLabelTTF.o)
cocos2d::CCLabelTTF::setFontSize(float) in libcocos2dx.a(CCLabelTTF.o)
cocos2d::CCLabelTTF::setFontName(char const*) in libcocos2dx.a(CCLabelTTF.o)
cocos2d::CCTextureCache::addImage(char const*) in libcocos2dx.a(CCTextureCache.o)
cocos2d::CCTextureCache::reloadTexture(char const*) in libcocos2dx.a(CCTextureCache.o)
…
“std::string::c_str() const”, referenced from:
cocos2d::CCLabelTTF::updateTexture() in libcocos2dx.a(CCLabelTTF.o)
cocos2d::CCLabelTTF::getString() in libcocos2dx.a(CCLabelTTF.o)
cocos2d::CCLabelTTF::description() in libcocos2dx.a(CCLabelTTF.o)
cocos2d::CCLabelTTF::getFontName() in libcocos2dx.a(CCLabelTTF.o)
cocos2d::CCFileUtilsIOS::isFileExist(std::string const&) in libcocos2dx.a(CCFileUtilsIOS.o)
cocos2d::CCFileUtilsIOS::getFullPathForDirectoryAndFilename(std::string const&, std::string const&) in libcocos2dx.a(CCFileUtilsIOS.o)
cocos2d::CCFileUtilsIOS::isAbsolutePath(std::string const&) in libcocos2dx.a(CCFileUtilsIOS.o)
…
。。。。。。。
deployment target 设置为 7.0
望大家帮助一下,谢谢啦