ziglua icon indicating copy to clipboard operation
ziglua copied to clipboard

Building DLLs to be used inside lua with `require`

Open Caue-Aron opened this issue 1 year ago • 1 comments

In the Lua C API we could write DLLs to be used as libraries in Lua, is there anything similar to such in ZigLua?

Caue-Aron avatar May 27 '24 11:05 Caue-Aron

Yes, you can do this! I don't have a good example of how yet, but you should be able to use the shared option with the ziglua dependency to link as a shared library, and then use ziglua.exportFn to export a module function.

Thanks for this good reminder to get this documented

natecraddock avatar Jun 12 '24 04:06 natecraddock

In the Lua C API we could write DLLs to be used as libraries in Lua, is there anything similar to such in ZigLua?

Did you ever find a way to do this?

Rolln-dev avatar Aug 21 '24 22:08 Rolln-dev

@Caue-Aron I did get this to work. See https://github.com/natecraddock/ziglua/issues/91#issuecomment-2305875459

Rolln-dev avatar Aug 22 '24 22:08 Rolln-dev