lua-users home
lua-l archive

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


Hello all. I've recently used SWIG to successfully bind a lot of C++
classes to be used from inside some lua scripts. However I want to be
able to create some of these objects in the C++ side and then expose
them to the Lua scripts and that's proving to be quite hard.

The SWIG function "_wrap_new_Class()" seems to create a new object of
type Class and leave it on top of the stack so it looks like the way
to go, but I'm getting an undefined reference to it. I tried to issue
a prototype like "extern _wrap_new_Class(lua_State* L);" in the file
using it but it doesn't seem to have any effect.

The compile line I'm using is more or like "g++ main.cpp
file_using_cpp_obj.o all_the_bound_classes.a -llua -ldl".

Thanks for your time