Lua-cURL / Lua-cURLv3

Lua binding to libcurl
MIT License
279 stars 64 forks source link

module 'lcurl' not found #190

Open Asukaaaaaa opened 1 year ago

Asukaaaaaa commented 1 year ago

Using luarocks to install lua-curl successfully on windows11. Then i put lcurl.dll and cURL.lua file into my script's directory.

├── cURL
│   ├── impl
│   │   └── cURL.lua
│   ├── safe.lua
│   └── utils.lua
├── cURL.lua
├── lcurl.dll
├── lcurl.so
└── main.lua

And running main.lua shows

PS C:\Users\zhong\Desktop\webdav> lua main.lua
C:\Users\zhong\scoop\apps\lua\current\lua54.exe: .\cURL.lua:11: module 'lcurl' not found:
        no field package.preload['lcurl']
        no file 'C:\Users\zhong\scoop\apps\lua\current\lua\lcurl.lua'
        no file 'C:\Users\zhong\scoop\apps\lua\current\lua\lcurl\init.lua'
        no file 'C:\Users\zhong\scoop\apps\lua\current\lcurl.lua'
        no file 'C:\Users\zhong\scoop\apps\lua\current\lcurl\init.lua'
        no file 'C:\Users\zhong\scoop\apps\lua\current\..\share\lua\5.4\lcurl.lua'
        no file 'C:\Users\zhong\scoop\apps\lua\current\..\share\lua\5.4\lcurl\init.lua'
        no file '.\lcurl.lua'
        no file '.\lcurl\init.lua'
        no file 'C:\Users\zhong\scoop\apps\lua\current'
stack traceback:
        [C]: in function 'require'
        .\cURL.lua:11: in main chunk
        [C]: in function 'require'
        main.lua:1: in main chunk
        [C]: in ?

But it runs perfectly on my wsl environment with lcurl.so, i don't know what's going wrong on windows side😥.

oktoberfest6 commented 11 months ago

Hi,

lcurl.dll depends on the libcurl library. Which tool do you use to compile lua-curl ? This tool provides the necessary files (header, .lib) to compile and you will certainly find the libcurl.dll in your tool folder. Copy libcurl.dll it near to your lua.exe, it should work.