您的位置:首页 > 移动开发 > Cocos引擎

使用Eclipse调试Android Native Application---cocos2d-x + Eclipse + Android + ndk

2014-04-03 21:19 429 查看
纠结很多天的ndk 调试, 终于在 mac 下面顺利完成(注意在windows还是没弄成功,蛋疼。。。)

调试方法:

1:先google, ndk demo . 把ndk 最基本的hellword 调试通过,网上的例子比较多,没出什么问题, 要注意一点的是,demo 起来的时候,在c++设置断点无效,需要demo 起来后,再用 jni 调c++,断点才有效果, 我这边反正是这样的情况。

2:cocos2d-x 调试, 参考地址:
http://blog.ready4go.com/blog/2013/05/17/how-to-debug-native-c-plus-plus-code-with-eclipse/
和 官网地址: http://www.cocos2d-x.org/wiki/How_to_debug_cocos2d-x_games
--- 让我纠结好几天没有搞清楚的事情,mac 一直报一个错误,结果呢, 网上一查,其他人也遇到了,还说不知道这么解决。让我郁闷了好几天。

错误信息如下:Could not load shared library symbols for 99 libraries, e.g. /system/bin/linker.

Use the "info sharedlibrary" command to see the complete listing.

Do you need "set solib-search-path" or "set sysroot"?

warning: Unable to find dynamic linker breakpoint function.

GDB will retry eventurally. Meanwhile, it is likely

that GDB is unable to debug shared library initializers

or resolve pending breakpoints after dlopen().

其实这不是问题,如果出现上面的信息,也是可以调试的,只不过游戏加载的时候,在c++ 设置断点无效,游戏起来后,再设置断点就OK了, 被这一个乌龙困惑了好几天。。。 记录下。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: