加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Cocos2dx跨平台编译Android错误:format not a string literal a

发布时间:2020-12-14 16:39:59 所属栏目:百科 来源:网络整理
导读:Cocos2dx 编译Android版时,提示出错: CCLOG(petname-getCString()); error: format not a string literal and no format arguments[-Werror=format-security]; 在强大网友的帮助下,找到一个问题的解决办法: 在对应项目的proj.android/jni/Application.m

Cocos2dx 编译Android版时,提示出错:

  1. CCLOG(petname->getCString());

error: format not a string literal and no format arguments[-Werror=format-security];

在强大网友的帮助下,找到一个问题的解决办法:

在对应项目的proj.android/jni/Application.mk添加:
APP_CFLAGS += -Wno-error=format-security

这是因为android-ndk-r9与Eclipse的版本不兼容导致的问题;

APP_CFLAGS : 一个C编译器开关集合,在编译任意模块的任意C或C++源代码时传递。它可以用于改变一个给定的应用程序需要依赖的模块的构建,而不是修改它自身的 Android.mk文件。在这里format-security即忽略上述错误(其实我之前也没看过Application.mk的内容,用到的时候再 研究吧)。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读