cocos2dx-Lua3.10版本使用cjson

参考:https://blog.csdn.net/shimazhuge/article/details/79848199

1.首先将cjson加入到libluacocos2d工程(cjson目录:/frameworks/cocos2d-x/external/lua

2.修改lua_extensions.c文件

加入两行代码

#include "cjson/lua_cjson.h"

{ "cjson", luaopen_cjson },

 

 3.编译之后,就能在lua代码中使用

local cjson = require "cjson"

  

原文地址:https://www.cnblogs.com/mingfuqishi/p/11458114.html