OpenResty 1.13.6.1 版本下 cjson 还是2.1.0 的版本,decode_array_with_array_mt 未定义.
cjson 最新 2.1.0.6 . Makefile 修改如下
LUA_VERSION = 5.3
TARGET = cjson.so
PREFIX = /usr/local/Cellar/lua/5.3.4_4
#CFLAGS = -g -Wall -pedantic -fno-inline
CFLAGS = -O3 -Wall -pedantic -DNDEBUG
CJSON_CFLAGS = -fpic
CJSON_LDFLAGS = -bundle -undefined dynamic_lookup
#LUA_INCLUDE_DIR ?= $(PREFIX)/include/lua5.3
LUA_INCLUDE_DIR ?= /usr/local/Cellar/openresty/1.13.6.1/luajit/include/luajit-2.1
#LUA_CMODULE_DIR ?= $(PREFIX)/lib/lua/$(LUA_VERSION)
LUA_CMODULE_DIR ?= /usr/local/Cellar/openresty/1.13.6.1/lualib
#LUA_MODULE_DIR ?= $(PREFIX)/share/lua/$(LUA_VERSION)
LUA_MODULE_DIR ?= $(PREFIX)/share/lua/lua5.3
LUA_BIN_DIR ?= $(PREFIX)/bin
网友评论