linux下cocos2d-x 2.2.1编译过程中的问题

1.编译过程中 将warnning 认定为error,修改方法试了很多种

      1)find . -name 'Application.mk' |xargs sed -i '1i APP_CPPFLAGS += -Wno-error=format-security'  #在所有Application.mk文件中添加一句话APP_CPPFLAGS += -Wno-error=format-security,这个是在很多国外网站上看到的,但实际还是报错,出错原因是把 unsigned int 转化成了 long unsigned int,%ui --> %lu  ,把相应文件的 lu全部改为ui后编译顺利通过


2.编译helloCpp的时候出错,大致为:

Using auto-detected project path: .
Found package name: org.cocos2dx.hellocpp
jni/Android.mk:19: *** Android NDK: Aborting.    。 停止。
ABIs targetted by application: Android NDK: WARNING: Ignoring unknown import directory: /home/wyl/work/tools/cocos2d-x/cocos2d-x-3.0alpha1/cocos/cocos2dx/platform/third_party/android/prebuilt    
Android NDK: jni/Android.mk: Cannot find module with tag 'cocos2dx' in import path    
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?    
Android NDK: The following directories were searched:    
Android NDK:         
Device API Level: 16
Device CPU ABIs: armeabi-v7a armeabi
ERROR: The device does not support the application's targetted CPU ABIs!
       Device supports:  armeabi-v7a armeabi
       Package supports: Android NDK: WARNING: Ignoring unknown import directory: /home/wyl/work/tools/cocos2d-x/cocos2d-x-3.0alpha1/cocos/cocos2dx/platform/third_party/android/prebuilt    
Android NDK: jni/Android.mk: Cannot find module with tag 'cocos2dx' in import path    
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?    
Android NDK: The following directories were searched:    
Android NDK:         

解决方法:export COCOS2DX_ROOT=/home/wyl/work/tools/cocos2d-x/cocos2d-x-2.2.1  路径设置出错,之前用的3.0 alpha,还有许多bug未修复,改成2.2后编译通过


3.继续编译还是出错:

ERROR: Package org.cocos2dx.hellocpp is not debuggable ! You can fix that in two ways:

  - Rebuilt with the NDK_DEBUG=1 option when calling 'ndk-build'.

  - Modify your manifest to set android:debuggable attribute to "true",
    then rebuild normally.

After one of these, re-install to the device!


解决方法:在Androidmanifest.xml中添加   android:debuggable="true"

          <application android:label="@string/app_name"
                 android:debuggable="true"
                 android:icon="@drawable/icon">



4.继续出错:

Found debuggable flag: true
ERROR: Could not find gdbserver binary under ./libs/armeabi
       This usually means you modified your AndroidManifest.xml to set
       the android:debuggable flag to 'true' but did not rebuild the
       native binaries. Please call 'ndk-build' to do so,
       *then* re-install to the device!



5.ndk 编译出错:

   undefined reference to `__gnu_thumb1_case_si 更换为r9后ok

6.将“adb_var_shell2 DATA_DIR run-as $PACKAGE_NAME /system/bin/sh -c pwd”用DATA_DIR="/data/data/$PACKAGE_NAME" 替换





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值