Lua and loadlib

Started by
2 comments, last by Monder 20 years ago
I''m trying to write a map exporter for the tile editor mappy, which has just recently added LUA support. However it seems the IO functions in LUA only output stuff in text mode and I want it in binary mode. So I hacked together a quick DLL to do binary file operations, which works fine. However for some reason the loadlib function when I use LUA in mappy isn''t there. Can anyone suggest another way to get the functions I need from the DLL into LUA? Or is there a way to do binary file IO using the functions LUA provides?
Advertisement
What problems is loadlib giving you?

Also, instead of rolling your own, you might want to check out lpack, which is written and maintained by LHF (one of the authors of Lua).

"Sneftel is correct, if rather vulgar." --Flarelocke
As far as I can tell it isn''t in the _G table (i.e. it hasn''t been defined). The exact error message is "Attempt to call global loadlib (a nil value)". I''ll check out lpack, see if it can do what I want.
Well it looks like lpack needs to use loadlib as well to work. Is there any other way I could load in functions from my DLL without loadlib? I think I''ll email the developer of mappy and ask him about it.

This topic is closed to new replies.

Advertisement