Properly load lua c library (.dll)?
Posted: 13 Mar 2013 13:12
Hello there! I'm trying to make use of luasocket library in my lua script by loading windows dll's with require('socket')
Plugin code is following:
Directory structure in lua/extensions:
And here is the output:
Could you please explain module loading mechanism of VLC?
What am I doing wrong? Could there be some workaround?
Plugin code is following:
Code: Select all
function descriptor()
return
{
title = "test",
version = "0.1",
capabilities = { "input-listener", "playing-listener" },
}
end
socket = require("socket")
function activate()
print("activated")
end
function deactivate()
print("deactivated")
end
Directory structure in lua/extensions:
Code: Select all
.
|-- plugin.lua
|-- modules
| |-- lua
| | |-- ltn12.lua
| | |-- mime.lua
| | |-- socket
| | | |-- ftp.lua
| | | |-- http.lua
| | | |-- smtp.lua
| | | |-- tp.lua
| | | `-- url.lua
| | `-- socket.lua
| |-- lua5.1.dll
| |-- lua5.1.exe
| |-- mime
| | `-- core.dll
| `-- socket
| `-- core.dll
Code: Select all
[02097680] lua generic debug: Activating extension 'test'
[02097680] lua generic warning: Error loading script C:\Program Files (x86)\Vide
oLAN\VLC\lua\extensions\plugin.lua: ...Files (x86)\VideoLAN\VLC\lua\extensions
\plugin.lua:43: module 'socket' not found:
no field package.preload['socket']
no file 'C:\Program Files (x86)\VideoLAN\VLC\lua\modules\socket.luac'
no file 'C:\Program Files (x86)\VideoLAN\VLC\lua\modules\socket.lua'
no file 'C:\Program Files (x86)\VideoLAN\VLC\lua\modules\socket.vle'
no file 'C:\Program Files (x86)\VideoLAN\VLC\lua\extensions\modules\socket.luac'
no file 'C:\Program Files (x86)\VideoLAN\VLC\lua\extensions\modules\socket.lua'
no file 'C:\Program Files (x86)\VideoLAN\VLC\lua\extensions\modules\socket.vle'
no file 'C:\Program Files (x86)\VideoLAN\VLC\lua\modules\socket.luac'
no file 'C:\Program Files (x86)\VideoLAN\VLC\lua\modules\socket.lua'
no file 'C:\Program Files (x86)\VideoLAN\VLC\lua\modules\socket.vle'
no file 'C:\Program Files (x86)\VideoLAN\VLC\lua\extensions\modules\socket.luac'
no file 'C:\Program Files (x86)\VideoLAN\VLC\lua\extensions\modules\socket.lua'
no file 'C:\Program Files (x86)\VideoLAN\VLC\lua\extensions\modules\socket.vle'
no file '.\socket.lua'
no file 'C:\Program Files (x86)\VideoLAN\VLC\lua\socket.lua'
no file 'C:\Program Files (x86)\VideoLAN\VLC\lua\socket\init.lua'
no file 'C:\Program Files (x86)\VideoLAN\VLC\socket.lua'
no file 'C:\Program Files (x86)\VideoLAN\VLC\socket\init.lua'
no file 'C:\Program Files (x86)\Lua\5.1\lua\socket.luac'
no file '.\socket.dll'
no file 'C:\Program Files (x86)\VideoLAN\VLC\socket.dll'
no file 'C:\Program Files (x86)\VideoLAN\VLC\loadall.dll'
[02097680] lua generic error: Could not activate extension!
[02097680] lua generic debug: Deactivating 'test'
[02097680] lua generic debug: Extension thread end: 'test'
What am I doing wrong? Could there be some workaround?