As I understand it, compat-5.1 is to make lua 5.0 module / package
compatible with 5.1, so that 'require', etc all work as expected in 5.1.
So, if you're using 5.1, you don't need the COMPAT_LOADLIB, etc, nor
All the best,
Walter Cruz wrote:
> Hi all. I've compiled lua 5.1 but I have some doubts:
> 1) Why the LUA_COMPAT_LOADLIB is not defined by default in luaconf.h?
> 2) Do I need still use the compat.lua?
> - Walter
1. (I'm working in Lua 5.1 under Windows with Microsoft Visual C++
compiler, so please excuse)
2. I had to recompile my module to work under Lua 5.1, and added a
int luaopen_wstring(lua_State* s)
which called luaL_openlib(..)
to register my library with Lua.
3. Then in Lua 5.1, I had only to go : x = require('wstring')
If you like, I can send you my source code for my wstring library - it's
just a demo library for something I was trying out. As I said, it's in
VC++, but I'm sure the concept is good. I don't know where this is
documented, I hacked the source from LuaExpat 1.0.1's code, right at the
bottom of lxplib.c: