Cocos2d-x v2.2.6是否支持安卓5.0 x86

Cocos JSCompile Patch for Cocos2d-x-2.2.6
This patch is updated for cocos2d-x JS developers to fix JSC file issue in cocos2d-x-2.2.6.
A patch of
is released to fix issue that JSC file can not work for JS developers.
Background
Cocos2d-x-2.2.6 was released several days ago to support IOS-64 bit. If you are a JS developer, you may find that JSC file generated by cocos jscompile can not work.
There are two ways to fix the problem.
Download the newest version of , the package has been updated to contain the patch.
If you already have cocos2d-x-2.2.6, please download the
and extract files to cocos2d-x root folder.
In cocos2d-x-2.2.6, we have rebuilt SpiderMonkey to support IOS-64bit for JS developers. The JSC file generated by cocos jscompile is not compatible with the new library, so we have rebuilt the tool in this patch. Here is the content of patch:
Fix JSC file issue mentioned above.
Unified cocos jscompile tool, the JSC file can be generated on MAC or Windows, and it can work on all supported platforms.
Sorry for the inconvenience.
Hello! Thanks for this update, but can you fix also this annoying bug, please?
Merry Christmas!
With this patch I have got following error after random crash (stacktrace I got with ndk-stack):
pid: 18737, tid: 18759, name: Thread-59712
&&& com.MyApp.Test &&&
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr
Stack frame #00
pc 0057026c
/data/app-lib/com.MyApp.Test-138/libcocos2djs.so: Unable to locate routine information for address 57026c in module /Users/sortris/DEV/cocos2d-x-2.2.6/projects/Test/proj.android/obj/local/armeabi//libcocos2djs.so
Stack frame #01
pc fffffffd
And after using addr2line I have got that line in file for memory address 57026c:
js::gc::MarkObjectRoot(JSTracer*, JSObject**, char const*)
libgcc2.c:0
Definitely it's great to be a member here in this wonderful platform. This is mainly because of the posts you guys publish with great useful content. I was looking for a long time to get useful source to learn and get advises about scripts and codes, finally I'm here. I'm a freelance writer and currently working for a
online. I'm using my free time to learn about something new and of course something interesting and engaging. I always had an impression for gaming and code creation for new attractive things. Now my desire getting more hopes as I'm with you guys to get effective support.
Recommended
Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.Cocos2d-x V2.x版本对64bit的支持 - yang3wei的专栏
- 博客频道 - CSDN.NET
原文链接:/meteoric_cry/p/4171535.html
日后新提交的应用必须要支持64位架构。
我所使用的是cocos2d-x V2.0版本,而且源码有部分代码是修改过的。好在cocos2d-x官方已经放出了一个支持64位的2.2.6版本,可以做为参考。
在修改之前,有必要了解一下32位与64位的一些区别,网上能搜索到的资料有很多,这里简单列一下(尽量通过图表的方式)
I代表int、L代码Long、P代表Pointer
通过上图,大家很容易就发现主要的不同点在long与pointer上
参考资料:
-------------------- 华丽的分隔线 --------------------
还有一些准备工作需要做,升级Mac OS,然后安装XCode 6.x,只有6.x才支持IOS8.x,然后设置build的选项。
然后command + b进行build,如果报错,查看报错的信息然后使用cocos2d-x 2.2.6版本里面的代码与当前使用的代码进行对比,修改完成之后再次build
第三方库:libcurl记得替代,如果你还使用了其它的库,记得也一并替换掉。
在编译的过程中遇到的绝大部分的问题都能通过搜索获得到答案 :)
上面这个过程相对而言比较简单,对于自已写的代码,如果有函数需要获得指针的信息,把 int 改为 long 即可 (原理可参见本文的第一张图)
我遇到的主要问题是
Undefined symbols for architecture arm64:&
&CocosDenshion::SimpleAudioEngine::preloadEffect(char const*)&, referenced from:
凡是调用了CocosDenshion里方法的代码都会显示有问题,我就奇怪了,CocosDenshion我检查过编译的各项参数,也检查过当前编译项目的Library Search Path,确认所有的都没有问题,清理、重新编译,闹腾了好久还是没解决,直到第二天猛然看到这段错误上面一段提示,有一个路径,我用shell查了一下,发现了问题:
该目录下面居然有一个.a文件,不知道怎么操作的,也就是说它优先使用了这里的库(32位),导致无论我怎么编译和操作,新生成的静态库(libCocosDenshion.a)都是没有用到的,删除、编译,一切都OK了,太坑了,花了一天半的时间&_&
下面引用一段关于Undefined symbols for architecture 的说明(网上能搜索到关于它的问题不是armv7(s)就是使用cocos2d-x V3.x的处理方案,关于cocos2d-x的几乎是没有,好忧伤~ ~)
如果在源代码中,找不到一个标识符的声明,无论是变量名、类名或是方法名,则在编译时会得到“Use of undeclared identifier 'XXXX'”错误,而如果编译器找到了它的声明,而却不知道它怎么实现的,看不到实现代码或者说目标文件里没有这个实现,则会出现链接错误。
错误分类:
1)&& 引入了需要用到的库的头文件,却没有链接正确的实现库。因为Xcode本身所支持的库是Static Library,即.a方式,.a文件里只有实现。使用的时候需要另外引入头文件,那么就有可能把头文件放进来,没有放.a或放了错误的版本。
2)& Build Settings或者Build Phases配置有误。检查Build Phases里的Link Binary With Libraries和Build Settings里的几项Search Path。
3)& 从外部导入的文件没有加入到特定的target中。.a、.m、.framework等引入到工程中,却没有勾选当前Build的target,会出现这个问题,可以选中特定的文件,在右侧边栏中选中target。
4)& 未包含处理器架构指令集的问题。报错时的提示一般都是“Undefined symbols for architecture armv7/arm64”之类的,而“for architecture armv7/arm64”就是说没有支持armv7,在build settings里architecture相关的几项需要配置正确。
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:960258次
积分:12985
积分:12985
排名:第371名
原创:227篇
转载:696篇
评论:147条
(10)(5)(6)(12)(7)(2)(7)(2)(1)(4)(2)(11)(5)(5)(10)(5)(8)(2)(2)(25)(1)(4)(8)(32)(13)(1)(9)(49)(55)(32)(49)(54)(54)(75)(58)(37)(9)(28)(48)(52)(21)(4)(4)(14)(8)(2)(74)}

我要回帖

更多关于 cocos2d x 安卓 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信