Lua-cURLv3 icon indicating copy to clipboard operation
Lua-cURLv3 copied to clipboard

module 'lcurl' not found

Open Asukaaaaaa opened this issue 2 years ago • 1 comments

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😥.

Asukaaaaaa avatar Nov 04 '23 14:11 Asukaaaaaa

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.

oktoberfest6 avatar Dec 07 '23 12:12 oktoberfest6