cloudwu / luaxlsx

28 stars 7 forks source link

请教编译使用方法 #5

Closed lincentma closed 3 years ago

lincentma commented 3 years ago

您好,在业务处理中需要读取excel文件数据并导入,想问下关于依赖安装的zip并没有找到,同时执行make命令提示,关于使用方法自己不是很熟悉,查阅了相关资料并没有理清使用的头绪,所以冒昧在这里提问了,非常感谢!

目前自己的运行环境为: nginx version: openresty/1.13.6.2 Linux b14adaddaadd 5.4.39-linuxkit #1 SMP Fri May 8 23:03:06 UTC 2020 x86_64 GNU/Linux

make命令执行错误信息: luaclib/luazip.c:3:17: fatal error: lua.h: No such file or directory luaclib/minizip/iowin32.h:14:21: fatal error: windows.h: No such file or directory

调用执行错误信息: 2020/11/18 16:25:18 [error] 17#17: *11770 lua entry thread aborted: runtime error: ./lib/resty/luaxlsx/xlsxreader/workbook.lua:1: module 'zip' not found: no field package.preload['zip'] no file '~/lua/zip.lua' no file '/usr/local/openresty/site/lualib/zip.ljbc' no file '/usr/local/openresty/site/lualib/zip/init.ljbc' no file '/usr/local/openresty/lualib/zip.ljbc' no file '/usr/local/openresty/lualib/zip/init.ljbc' no file '/usr/local/openresty/site/lualib/zip.lua' no file '/usr/local/openresty/site/lualib/zip/init.lua' no file '/usr/local/openresty/lualib/zip.lua' no file '/usr/local/openresty/lualib/zip/init.lua' no file './zip.lua' no file '/usr/local/openresty/luajit/share/luajit-2.1.0-beta3/zip.lua' no file '/usr/local/share/lua/5.1/zip.lua' no file '/usr/local/share/lua/5.1/zip/init.lua' no file '/usr/local/openresty/luajit/share/lua/5.1/zip.lua' no file '/usr/local/openresty/luajit/share/lua/5.1/zip/init.lua' no file '/usr/local/openresty/site/lualib/zip.so' no file '/usr/local/openresty/lualib/zip.so' no file './zip.so' no file '/usr/local/lib/lua/5.1/zip.so' no file '/usr/local/openresty/luajit/lib/lua/5.1/zip.so' no file '/usr/local/lib/lua/5.1/loadall.so' stack traceback:

cloudwu commented 3 years ago

zip 库的实现在 https://github.com/cloudwu/luaxlsx/blob/master/luaclib/luazip.c 你需要有能力自己编译出来。

这不是个正式的项目,不解决构建问题。如果你不会使用编译工具,建议去找更成熟的方案。

lincentma commented 3 years ago

感谢您的回复,自己在编译工具使用方面实践不多,我这边再学习了解下,感谢!