Closed hdt80 closed 8 years ago
Chances are you're not compiling with the define LUA_COMPAT_ALL
, which keeps methods like lua_tounsigned
available for use (I'm assuming you're using the latest lua, lua 5.3).
Also, if you still have problems after doing -DLUA_COMPAT_ALL
, try using the updated version of the library here.
Would I put that flag in my compilation command?
Yes.
I'm at school so I'll rest that when I get can, thanks you for your help.
I tried both compilers with -DLUA_COMPACT_ALL, and then using the updated version but I couldn't get either one to work. I'll open an issue in the updated version. Thanks for the help!
It's not LUA_COMPACT_ALL
, it's LUA_COMPAT_ALL
(no C).
My apologies, I used -DLUA_COMPAT_ALL
, not -DLUA_COMPACT_ALL
. I typed it wrong in my Github comment.
Looks like using the updated version of the library fixed that, thanks for the help!
In my case, I use lua5.3.4, the macro is LUA_COMPAT_APIINTCASTS.
I'm creating a tower defense game that uses Lua as a scripting engine.
When compiling with both g++ and clang++ I get the following error.
I am using the following command to compile:
I believe there error crops up when I'm defining my classes to use inside Lua. I created a class called
LuaScript
. Here are the .h and .cpp filesLuaScript.h
LuaScript.cpp
All my Tower methods have been defined in
Tower.cpp
andTower.h
. Here are the relevant parts.Tower.h
If I uncomment
"setRange", &Tower::setRange
I get the undeclared error, but commenting it out works fine.Tower::setRange
is set inside Object.h, the parent class of Tower.Object.h
I don't understand why that specific method would cause issues with Sol. All the other methods I've declared work with Sol, and compile fine, but that method throws the error.
If I'm doing something wrong or I need to provide some more information let me so I can get this figured out.