vs 2015 编译cocos2dx 报错C1189 #error: Macro definition of snprintf conflicts with Standard Library func

前端之家收集整理的这篇文章主要介绍了vs 2015 编译cocos2dx 报错C1189 #error: Macro definition of snprintf conflicts with Standard Library func前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

装好@H_502_2@vs2015打开原来的@H_502_2@cocos2dx项目遇到了一个错误C1189#error:MacrodefinitionofsnprintfconflictswithStandardLibraryfunctiondeclaration。

一直搞不明白是什么原因,搜索了大量资料才解决

原因:vs2015里面已经自己定义了snpritf(),而cocos里面又重新定义了一遍,所以出现了冲突;

#ifdefsnprintf

#error:MacrodefinitionofsnprintfconflictswithStandardLibraryfunctiondeclaration”

#endif

解决删除cocos2dcocos2d\cocos\platform\win32\CCStdC-win32.h代码

#if!defined(isnan)

#defineisnan_isnan

#endif

#ifndefsnprintf

#definesnprintf_snprintf

来自:http://www.byjth.com/jiqiao/42.html

原文链接:https://www.f2er.com/cocos2dx/339231.html

猜你在找的Cocos2d-x相关文章