lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi all, I'm new to the Lua scene and starting to get things compiling under Win32 (Visual Studio 2k5) and have a few questions:

1) My very simple test only does the following things:

void MyLuaTest()
{
    lua_State* L = lua_open();
    luaL_openlibs(L);
    ...

The latter function I understand is the helper to replace the 5.0 scheme of luaopen_*. Unfortunately this only gets so far...

>    test.exe!setprogdir (lua_State * L=0x009da450)  Line 106    C
     test.exe!setpath(lua_State * L=0x009da450, const char * fieldname=0x004e6470, const char * envname=0x004e6680, const char * def=0x004e668c)  Line 605 + 0x9 bytes    C
     test.exe!luaopen_package(lua_State * L=0x009da450)  Line 650 + 0x18 bytes    C
     test.exe!luaD_precall(lua_State * L=0x009da450, lua_TValue * func=0x009da718, int nresults=0)  Line 319 + 0x16 bytes    C
     test.exe!luaD_call (lua_State * L=0x009da450, lua_TValue * func=0x009da718, int nResults=0)  Line 376 + 0x11 bytes    C
     test.exe!lua_call(lua_State * L=0x009da450, int nargs=1, int nresults=0)  Line 775 + 0x11 bytes    C
     test.exe!luaL_openlibs (lua_State * L=0x009da450)  Line 35 + 0xd bytes    C
     test.exe!MyLuaTest()  Line 25 + 0x9 bytes    C++

Because the Windows API call GetModuleFileName() in setprogdir() is failing I believe due to the fact that I am statically linking the Lua library into my code. Is this supported? It seemed to work fine with the 5.0 libraries, but a quick search in those didn't reveal similar path-grabbing functionality. Should I just dynamically link and be done with it?

2) Does defining LUA_COMPAT_GETN in luaconf.h interfere with the new length operator functionality? I ask because I also wish to try out LuaBind which seems to rely on it to compile. I realize that library has its own mailing list, but this one seems substantially more active and I would guess someone has LuaBind running with 5.1...

Thanks a lot! I'm excited to see what's behind the good word for the language

Stuart