首页 > 解决方案 > 使用 luarocks 安装 lua 请求时出错

问题描述

你好stackoverflow的好人,

luarocks install lua-requests在命令行中使用安装 lua-requests 模块时遇到问题。所述模块的一些依赖项将毫无问题地安装,但luasec会导致问题。

起初,我收到以下错误:

C:\Users\user>luarocks install luasec
Installing https://luarocks.org/luasec-0.9-1.src.rock

Error: Could not find header file for OPENSSL
  No file openssl/ssl.h in c:/external/include
  No file openssl/ssl.h in c:/mingw/include
  No file openssl/ssl.h in c:/windows/system32/include
You may have to install OPENSSL in your system and/or pass OPENSSL_DIR or OPENSSL_INCDIR to the luarocks command.
Example: luarocks install luasec OPENSSL_DIR=/usr/local

但是,我可以通过下载 OpenSSL 并在命令行中使用以下命令来修复它:

C:\Users\user>luarocks install luasec OPENSSL_DIR=" *path to openssl directory* "

然后导致以下错误:

C:\Users\user>luarocks install luasec OPENSSL_DIR=" *path to openssl directory* "
Installing https://luarocks.org/luasec-0.9-1.src.rock

c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -llibssl32MD
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -llibcrypto32MD
collect2.exe: error: ld returned 1 exit status

Error: Build error: Failed compiling module ssl.dll

谷歌搜索了一段时间后,我发现了以下问题https://github.com/brunoos/luasec/issues/150

我尝试重命名 dll,但再次没有运气。所以,现在我有点卡住了,不知道该怎么做......如果有人对如何进行有任何提示或建议,我将非常感激。

在此先感谢,祝您有美好的一天:)

标签: luaopensslluarocksluasec

解决方案


推荐阅读