lua-users home
lua-l archive

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


Okay, I tried including all of LuaBind's files in my project and it works fine now... But I still wanted to use a linked library. Now every time I want to clean/rebuild my project all of those files will build too!

L-28C wrote:
Hello everyone!

I cannot seem to get LuaBind to work. It compiles without problems (except that I must manually define LUA_REFNIL and LUA_NOREF to their respective values)

But then it crashes. Look at my code, the debug pointer is placed in the marked line:

----------------------------
#include "LuaBot.hpp" // Includes headers

void greet()
{
    std::cout << "hello world!\n";
}

int init()
{
    L = lua_open();
    if (L == NULL) return -1;

    luaL_openlibs(L);

    open(L);

    return 0;
}

int main (int argc, char *argv[])
{
    if (init() != 0)
        return -1;

    module(L)
    [
        def("greet", &greet)
    ]; //                    << Crash here

    luaL_dofile(L, "lua.lua");

    return 0;
}
----------------------------

If I remove the whole module block, it runs fine.

Compiler is MSVC++ Express 2008. Help? Thanks in advance!