lua-users home
lua-l archive

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


Hello,

I am using LUA in my game...One of my classes registers one of its
methods, Add(), with LUA, so that it can be called by LUA. I have
reduced my Add() method to simply doing a myvector.push_back(5),
myvector is a private variable in my class, vector<int> myvector. Am I
supposed to be using LUA differently with c++?

BTW, I think LUA is great, I just wish I can get this to work. Thanks.

My app dumps core somewhere within the stl code. Here is the backtrace:
#0  GameMap::AddTileBitmap (this=0x0, image=0x805f608)
    at /usr/local/include/g++/stl_vector.h:145
145         if (finish != end_of_storage) {
(gdb) bt
#0  GameMap::AddTileBitmap (this=0x0, image=0x805f608)
    at /usr/local/include/g++/stl_vector.h:145
#1  0x8049b83 in GameMap::AddTile (this=0x0) at game_map.cpp:56
#2  0x804b42c in callC () at game_map.cpp:64
#3  0x804b594 in luaD_calln () at game_map.cpp:64
#4  0x80507df in luaV_execute () at game_map.cpp:64
#5  0x804b5b6 in luaD_calln () at game_map.cpp:64
#6  0x80507df in luaV_execute () at game_map.cpp:64
#7  0x804b5b6 in luaD_calln () at game_map.cpp:64
#8  0x804b879 in luaD_protectedrun () at game_map.cpp:64
#9  0x804ba96 in do_main () at game_map.cpp:64
#10 0x804bbc8 in lua_dofile () at game_map.cpp:64
#11 0x804999c in GameMap::Load (this=0x805bdd8, 
    script_file=0x8054e22 "script/tileset_regular.lua") at
game_map.cpp:38
#12 0x80495a1 in Gecko::main (this=0x8058c78, argc=1, argv=0xbffffce4)
    at gecko.cpp:22
#13 0x4004bb66 in ?? () from /usr/local/lib/libclan.so.0
Current language:  auto; currently c++