xcode 运行 cocos2dx 项目问题总结

由于管理公司游戏项目ios的打包,且都是cocos2dx项目。经常碰到各种各样的问题,打算以后碰到的问题记录下来...

1.这个是折腾了我挺久的一个问题

Undefined symbols for architecture armv7:
"cocos2d::CCDictionary::removeObjectForKey(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
tolua_Cocos2d_CCDictionary_removeObjectForKey00(lua_State*) in liblua.a(LuaCocos2d.o)
tolua_Cocos2dx_ActionTimeline_clearFrameEventCallFunc00(lua_State*) in liblua.a(lua_cocos2dx_cocostudio_manual.o)
cocostudio::timeline::ActionTimelineCache::removeAction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libextensions.a(CCActionTimelineCache.o)
cocos2d::extension::CCArmature::removeBone(cocos2d::extension::CCBone*, bool) in libextensions.a(CCArmature.o)
cocos2d::extension::CCArmatureDataManager::removeArmatureData(char const*) in libextensions.a(CCArmatureDataManager.o)
cocos2d::extension::CCArmatureDataManager::removeAnimationData(char const*) in libextensions.a(CCArmatureDataManager.o)
cocos2d::extension::CCArmatureDataManager::removeTextureData(char const*) in libextensions.a(CCArmatureDataManager.o)
...
"non-virtual thunk to cocos2d::CCTextFieldTTF::getContentText()", referenced from:
vtable for cocos2d::ui::UICCTextField in libextensions.a(UITextField.o)
"cocos2d::CCDictionary::valueForKey(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
tolua_Cocos2d_CCDictionary_valueForKey00(lua_State*) in liblua.a(LuaCocos2d.o)
"non-virtual thunk to cocos2d::CCTextFieldTTF::attachWithIME()", referenced from:
vtable for cocos2d::ui::UICCTextField in libextensions.a(UITextField.o)
"non-virtual thunk to cocos2d::CCTextFieldTTF::detachWithIME()", referenced from:
vtable for cocos2d::ui::UICCTextField in libextensions.a(UITextField.o)
"cocos2d::CCString::create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
cocos2d::extension::CCControlButton::initWithLabelAndBackgroundSprite(cocos2d::CCNode*, cocos2d::extension::CCScale9Sprite*) in libextensions.a(CCControlButton.o)
cocos2d::extension::CCControlButton::getTitleForState(unsigned int) in libextensions.a(CCControlButton.o)
cocos2d::extension::CCControlButton::setTitleTTFForState(char const*, unsigned int) in libextensions.a(CCControlButton.o)
cocos2d::extension::CCControlButton::setTitleBMFontForState(char const*, unsigned int) in libextensions.a(CCControlButton.o)
cocos2d::extension::CCBAnimationManager::addDocumentCallbackName(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in libextensions.a(CCBAnimationManager.o)
cocos2d::extension::CCBAnimationManager::addDocumentOutletName(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in libextensions.a(CCBAnimationManager.o)
cocos2d::extension::CCBReader::readCallbackKeyframesForSeq(cocos2d::extension::CCBSequence*) in libextensions.a(CCBReader.o)
...
"non-virtual thunk to cocos2d::CCTextFieldTTF::canAttachWithIME()", referenced from:
vtable for cocos2d::ui::UICCTextField in libextensions.a(UITextField.o)
"non-virtual thunk to cocos2d::CCTextFieldTTF::canDetachWithIME()", referenced from:
vtable for cocos2d::ui::UICCTextField in libextensions.a(UITextField.o)
"cocos2d::CCFileUtils::getPathForFilename(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
vtable for CFileUtilsZpk in FileUtilsZpk.o
"cocos2d::CCDictionary::objectForKey(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
cocos2d::extension::CCBAnimationManager::getBaseValue(cocos2d::CCNode*, char const*) in libextensions.a(CCBAnimationManager.o)
cocos2d::extension::CCBAnimationManager::actionForCallbackChannel(cocos2d::extension::CCBSequenceProperty*) in libextensions.a(CCBAnimationManager.o)
cocos2d::extension::CCBAnimationManager::runAnimationsForSequenceIdTweenDuration(int, float) in libextensions.a(CCBAnimationManager.o)
tolua_Cocos2d_CCDictionary_objectForKey00(lua_State*) in liblua.a(LuaCocos2d.o)
cocostudio::timeline::NodeReader::loadNode(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> > const&, cocos2d::CCNode*) in libextensions.a(CCNodeReader.o)
cocostudio::timeline::ActionTimelineCache::createAction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libextensions.a(CCActionTimelineCache.o)
cocostudio::timeline::ActionTimelineCache::loadAnimationActionWithContent(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libextensions.a(CCActionTimelineCache.o)
...
"cocos2d::CCFileUtilsIOS::getFullPathForDirectoryAndFilename(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
vtable for CFileUtilsZpk in FileUtilsZpk.o
"cocos2d::CCFileUtilsIOS::writeToFile(cocos2d::CCDictionary*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
vtable for CFileUtilsZpk in FileUtilsZpk.o
"cocos2d::CCUserDefault::getStringForKey(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
NewAccMainMenu::loadAccInfo() in LoginMenu.o
QuestGuideMenu::LoadConfig() in MapGuideMenu.o
"cocos2d::CCFileUtilsIOS::createCCArrayWithContentsOfFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
vtable for CFileUtilsZpk in FileUtilsZpk.o
"cocos2d::CCPointArray::setControlPoints(std::__1::vector<cocos2d::CCPoint*, std::__1::allocator<cocos2d::CCPoint*> >*)", referenced from:
tolua_Cocos2d_CCPointArray_setControlPoints00(lua_State*) in liblua.a(LuaCocos2d.o)
"cocos2d::CCUserDefault::setStringForKey(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
NewAccMainMenu::SaveAccInfo() in LoginMenu.o
QuestGuideMenu::SaveConfig() in MapGuideMenu.o
tolua_Cocos2d_CCUserDefault_setStringForKey00(lua_State*) in liblua.a(LuaCocos2d.o)
"cocos2d::CCDictionary::setObject(cocos2d::CCObject*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
addValueToCCDict(objc_object*, objc_object*, cocos2d::CCDictionary*) in FMLayerWebView.o
cocos2d::extension::CCBAnimationManager::setBaseValue(cocos2d::CCObject*, cocos2d::CCNode*, char const*) in libextensions.a(CCBAnimationManager.o)
cocos2d::extension::CCBReader::readNodeGraph(cocos2d::CCNode*) in libextensions.a(CCBReader.o)
cocos2d::extension::CCNodeLoader::onHandlePropTypeFloat(cocos2d::CCNode*, cocos2d::CCNode*, char const*, float, cocos2d::extension::CCBReader*) in libextensions.a(CCNodeLoader.o)
cocos2d::extension::CCNodeLoader::onHandlePropTypeInteger(cocos2d::CCNode*, cocos2d::CCNode*, char const*, int, cocos2d::extension::CCBReader*) in libextensions.a(CCNodeLoader.o)
cocos2d::extension::CCNodeLoader::onHandlePropTypeCheck(cocos2d::CCNode*, cocos2d::CCNode*, char const*, bool, cocos2d::extension::CCBReader*) in libextensions.a(CCNodeLoader.o)
cocos2d::extension::CCNodeLoader::onHandlePropTypeString(cocos2d::CCNode*, cocos2d::CCNode*, char const*, char const*, cocos2d::extension::CCBReader*) in libextensions.a(CCNodeLoader.o)
...
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Showing first 200 warnings only

这个也是比较多出现的问题,找不到所要的符号。但是其实我的.a静态库是存在的,并且也包含了

解决方案:

1. 将游戏项目的 Deployment Target 改成7.0以下

2. 将cocos2dx重新编译一遍, Build Settings->Apple LLVM *.0 -Language -C++  按下面配置

其他cocosDenshion和extensions也按这个配置

然后该问题解决

...(待续)

时间: 2024-11-01 02:19:35

xcode 运行 cocos2dx 项目问题总结的相关文章

ubuntu 下配置/编译/运行 cocos2dx项目

由于项目原因,需要把一个使用cocos2dx的项目放到linux下运行(在windows下使用VS编写,可以正常运行),晚上调试了大概3 -4小时,终于把项目运行了起来.在这里记录一下注意的事项,方便自己也能提醒大家不要犯一样的错误. 我使用的是ubuntu kylin 14.04 , cocos2dx版本是2.2.3. 项目工程文件如下: 已经包含了cocos2dx的文件包,自己的项目是在projects中. projects文件夹内容如下: Classes文件夹中是项目的源文件,包括一些.h

Xcode 运行cocos2dx弹出内部错误对话框

cocos2dx未捕获的异常升高.选择"继续"继续运行在一个不一致的状态.选择"崩溃"停止应用和崩溃报告一个错误文件. 莫名其妙,代码没有报错,运行时却弹出(内部错误)对话框出来: 再看看崩溃的底层代码片段: 对,没错,是字符串出了问题,把工程中有关字符串的代码检查一遍稍作修改即可:

从mac终端创建cocos2d-x项目在xcode和eclipse正常运行环境配置

一.创建可以同时运行在xcode和eclipse的项目: 1.打开mac终端,进入cocos2d-x目录下的tools/project-creator,执行命令./create_project.py -project [项目名] -package [包名] -language [使用语言cpp或java等]然后就能在cocos2d-x目录下的projects中看到新生成的项目了. 2.把创建的项目放在D:\cocos2d\cocos2d-x-2.1.4\projects目录下,如果没有proje

codeblocks中cocos2dx项目添加新的.cpp和.h文件后编译运行的方法

新建了cocos2dx项目后(比如我这里建立的项目名为Test01),项目目录下有如下目录和文件: bin CMakeLists.txt MyGame.layout proj.win10 Classes cocos2d proj.android proj.win32 CMakeCache.txt lib proj.android-studio proj.win8.1-universal CMakeFiles Makefile proj.ios_mac Resources cmake_instal

cocos2d-x项目(windows) 打包iOS前 运行调试基本的流程

1.在mac系统下:找到项目文件,proj.ios文件夹下找到:项目名称.xcodeproj双击打开. 2.进入xcode开发环境以后,会发现Class文件夹下面只有4个基本文件,项目中的游戏类那? 这时不要着急,选中Class右键选择Show in Finde 自己新建的类找到了,小激动有不有?接下来就要做一件非常有重大意义的事情啦,那就是把自己新建的类选中后,拖动到xcode打开的项目Classes下: 3.Resourse文件夹下默认是: 用2中同样的方法,将项目中用到的资源拖到这Reso

Mac下编译libpomelo静态库,并在cocos2dx项目中引用

最近在学习cocos2dx的过程中需要和服务器进行交互,所以这几天在学习libpomelo静态库的编译和使用.之前在windows系统下编译libpomelo,并在VS中引入比较顺利:但是,目前对Mac系统和XCode不是很熟悉,所以多花了些时间.不过,最终还是成功了,在这里就将我编译引入libpomelo静态库的过程记录下来,也分享给和我一样遇到问题的朋友们. 准备工作 libpomelo下载地址:https://github.com/NetEase/libpomelo或者http://pan

iOS 平台 Cocos2d-x 项目接入新浪微博 SDK 的坑

iOS 平台 Cocos2d-x 项目接入新浪微博 SDK 的坑 最近在做一个 iOS 的 cocos2d-x 项目接入新浪微博 SDK 的时候被“坑”了,最后终于顺利的解决了.发现网上也有不少人遇到一样的问题,但是能找到的数量有限的解决办法写得都不详细,很难让人理解,我来深入的写一写. 我的开发环境 Mac OS X 10.10.1 Xcode 6.1.1 (6A2008a) Cocos2d-x 3.2 新浪微博 SDK for iOS 2015 年 1 月 5 日从 github clone

《转》iOS 平台 Cocos2d-x 项目接入新浪微博 SDK 的坑

最近在做一个 iOS 的 cocos2d-x 项目接入新浪微博 SDK 的时候被“坑”了,最后终于顺利的解决了.发现网上也有不少人遇到一样的问题,但是能找到的数量有限的解决办法写得都不详细,很难让人理解,我来深入的写一写. 我的开发环境 Mac OS X 10.10.1 Xcode 6.1.1 (6A2008a) Cocos2d-x 3.2 新浪微博 SDK for iOS 2015 年 1 月 5 日从 github clone 的版本 遇到的问题 根据新浪微博 SDK 附带的文档接入项目后,

1.将cocos2d-x项目移植到Linux环境下,将cocos2d-x项目移植到手机上

 1.将cocos2d-x相关的软件包拷贝到Linux下. 2 对上面的安装包进行解压 3 执行cocos2dx-2.2.3/install-deps-linux.sh(执行这个命令需要有网络) 4 安装QT,命令:sudoapt-get install qt-sdk 5 在cocos2dx-2.2.3目录下,执行./make-all-linux-project.sh 6 要让64位的linux能运行32位的adb,aapt工具,需要安装以下软件 sudo apt-get install g