今天cocos2d-x打包 android的时候报错:format not a string literal and no format arguments 报错点是:__String::createWithFormat(s_szFuWenEffect2[GetType()])->getCString() 代码vs2015编译是通过的,没任何问题. 修改方法:__String::createWithFormat("%s", s_szFuWenEffect2[GetType()])…
在Android Studio2.2 进行NDK编程,在对*char 字符串 进行日志输出时,报错: error: format not a string literal and no format arguments [-Werror=format-security] 代码: 网上说是版本不兼容导致的!搜索了下解决 方法如下: 解决方法: 在你的ndk目录下修改build/core/default-build-commands.mk TARGET_FORMAT_STRING_CFLAGS :=…
原文地址 : http://www.cnblogs.com/hhuang2012/p/3336911.html cocos2dx android版本移植时的Error format not a string literal and no format arguments解决方案 [-Werror=format-security] BUG FIX SOLUTION 场景: cocos2dx 跨平台开发, 移植Android版本时, 当进行到build_native.sh步骤后 ndk版本: and…
编译错误时使用的android-ndk为r9的版本号.报下面错误: "Compile++ thumb : cocosdenshion_static <= SimpleAudioEngine.cpp" "/Users/linyou/Documents/cocos2d-x/F10Attack/proj.android/../../CocosDenshion/android/SimpleAudioEngine.cpp: In constructor 'CocosDenshio…
原地址: http://blog.csdn.net/joeblackzqq/article/details/25985299 cData.cpp:355:30:error:format not a string literal and no fomat arguments [-Werror=format-security]cData.cpp:387:42:error:format not a string literal and no fomat arguments [-Werror=forma…
You can put this in your Application.mk to disable treating those warnings as errors: APP_CFLAGS += -Wno-error=format-security There are more solutions for the same problem in this thread: http://www.cocos2d-x.org/boards/6/topics/32437?r=33260\#messa…
平时用的都是Centos系统,今天偶然在Ubuntu下编译了一次代码,发现报错了: 源码: #include <stdio.h> #include <sys/time.h> #include <time.h> int main(int argc,char * argv[]) { struct timeval tv; gettimeofday(&tv,NULL); printf("time %u:%u\n",tv.tv_sec,tv.tv_us…
const char* && string && String^ 类型转换 const char* ---> string const char * cw= "kkkkkkkkkk"; string sw = cw; string ---> const char* using namespace std; string s = "kkkkk"; const char* cc = s.data(); const char*…
本文转自 http://blog.csdn.net/perfumekristy/article/details/7027678 const char* 和string 转换 const char*转换为 string,直接赋值即可 EX: const char* tmp = "hello world!". string s = tmp; string转换为const char*,利用c_str() EX: string s = "hello world"; cons…
本文转自:https://blog.csdn.net/rongrongyaofeiqi/article/details/52442169 一:转化总结形式如下: 使用时,要对源格式和目标格式进行初始化.源格式赋值为具体的内容,目标格式赋值为空. 二.总结方法: 1.        变成string,直接赋值. 2.        char[]变成别的,直接赋值. 3.        char*变constchar*容易,const char*变char*麻烦.<const_cast><c…