1)https://github.com/LuaDist/luaxml下载压缩包解压到指定目录
2)修改Makefile文件
INCDIR = -I/usr/local/openresty/luajit/include/luajit-2.1
LIBDIR = -L. -L/usr/local/openresty/luajit/lib
LIBS = $(LIBDIR) $(LIB) -lluajit-5.1 -ldl
LIBS = $(LIBDIR) -L/usr/local/lib $(LIB) -lluajit-5.1
3)make clean * make
4)拷贝LuaXML_lib.so以及LuaXml.lua到/usr/local/openresty/lualib/
5)然后使用的时候遇到了找不到动态链接库的问题
cat /etc/ld.so.conf
echo "/usr/local/openresty/luajit/lib/" >> /etc/ld.so.conf
ldconfig
网友评论