转载自:https://www.cnblogs.com/mingfuqishi/p/11458114.html

 

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

 

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

cocoslua3.10升级到cocos3.17.2 记录(二)

2.修改lua_extensions.c文件

加入两行代码

#include "cjson/lua_cjson.h"

{ "cjson", luaopen_cjson },

 cocoslua3.10升级到cocos3.17.2 记录(二)

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

local cjson = require "cjson"

相关文章:

  • 2021-11-05
  • 2021-11-23
  • 2021-11-27
  • 2021-11-11
  • 2022-01-16
  • 2021-06-27
  • 2021-08-05
  • 2021-11-04
猜你喜欢
  • 2021-11-19
  • 2021-08-31
  • 2022-01-22
  • 2021-11-05
  • 2022-01-22
  • 2021-12-20
  • 2021-09-19
相关资源
相似解决方案