mlua
mlua copied to clipboard
lua how to requre dll
I want to integrate idea debugging tools in Lua, but MLUa does not seem to support loading external DLLS for use, here is the sample code:
package.cpath = package.cpath .. ';C:/Users/UserData/AppData/Roaming/JetBrains/IntelliJIdea2021.2/plugins/EmmyLua/classes/debugger/emmy/windows/x64/?.dll' local dbg = require('emmy_core') dbg.tcpConnect('localhost', 9966)//emmy_core crash
From the doc you need to use Lua::new_unsafe to load DLLs
From the
docyou need to useLua::new_unsafeto load DLLs
Even though use Lua::new_unsafe, it's still not possible to use loaded DLLS in Lua. Integrating Lua debugging tools (such as EmmyLua) is what most projects need to do.It would be nice to provide a working example.Here is my simple sample code
What is the error that you receive? Are you sure that the c library you load is compatible with the version of lua that you let mlua run? Did you enable the debug module on mlua's side? (At least, I would imagine a debugger needs access to that)
There are also debuggers written entirely in lua, do those work?