lua-cjson在vs2015下编译

lua-cjon是一个支持lua中使用json的开源库,基于linux平台开发。

可以使用mingw32编译出windows下的库。

因为我希望vs2015进行编译(主要其它库在windows平台都是使用的vs2015,没有使用mingw),

出现错误1:

原因:strncasecmp是linux下的函数,windows平台对应等价函数为_strnicmp,

解决方案:

在strbuf.h中添加以下代码:

#if defined(_WIN32) || defined(_WIN64)
  #define strncasecmp _strnicmp
#endif

顺利解决。

参考:http://botsikas.blogspot.com/2011/12/strcasecmp-identifier-not-found-when.html

出现错误2:

参考:https://msdn.microsoft.com/en-us/library/4t91x2k5.aspx

原因是 在64位系统上,指针是64位,这里按32位进行输出了,所以导致输出一个警告。

 

我们可以直接忽略,因为只是一个输出不影响运行。

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


Warning: Use of undefined constant XML - assumed 'XML' (this will throw an Error in a future version of PHP) in /opt/wordpress/wp-content/plugins/wp-syntaxhighlighter/wp-syntaxhighlighter.php on line 1048