Cocos2dx跨平台编译Android错误:format not a string literal and no format arguments [-Werror=format-security]
2014-11-28 19:38
369 查看
Windows下Crywin环境(android-ndk-r9),Cocos2dx 编译Android版时,提示出错:
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的内容,用到的时候再研究吧)。
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的内容,用到的时候再研究吧)。
相关文章推荐
- Cocos2dx跨平台编译Android错误:format not a string literal and no format arguments [-Werror=format-security]
- Android Studio error: format not a string literal and no format arguments [-Werror=format-security]
- android jni 出现format not a string literal and no format arguments [-Werror=format-security]问题
- error: format not a string literal and no format arguments [-Werror=format-security];
- cocos2dx android版本移植时的Error format not a string literal and no format arguments解决方案
- cocos2dx android版本移植时的Error format not a string literal and no format arguments解决方案
- cocos2dx android版本移植时的Error format not a string literal and no format arguments解决方案
- cocos2dx android版本移植时的Error format not a string literal and no format arguments解决方案
- format not a string literal and no format arguments [-Werror=format-security]
- error: format not a string literal and no format arguments [-Werror=format-security]
- Android ndk报错error: format not a string literal and no format arguments [-Werror=format-security]
- cocos2dx android版本移植时的Error format not a string literal and no format arguments解决方案
- cocos2dx android版本移植时的Error format not a string literal and no format arguments解决方案
- Android ndk报错error: format not a string literal and no format arguments [-Werror=format-security]
- Android ndk报错error: format not a string literal and no format arguments [-Werror=format-security]
- format not a string literal and no format arguments [-Werror=format-security]
- cocos2dx android版本移植时的Error format not a string literal and no format arguments解决方案
- :error: format not a string literal and no format arguments [-Werror=format-security]
- error: format not a string literal and no format arguments [-Werror=format-security]
- cocos2dx android版本移植时的Error format not a string literal and no format arguments解决方案