Problems with the Lua Resource
by Michael Branin · in Torque Game Engine · 04/13/2006 (1:36 pm) · 4 replies
Anyone else having this issue or know the answer to this issue I am having with this resource
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9665
I have gotten this merged in now but I keep getting this one single error
..\engine\game\main.cc(6) : fatal error C1083: Cannot open include file: 'lua_inc.h': No such file or directory
Now lua_inc.h is located in torque\lib\lua\lua and in my projects setting I added /lib/lua to the Additional Libraries Directories of the Linker/General section of my Projects Settings and yet it still will not find 'lua_inc.h' Can anyone help me figure this one out?
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9665
I have gotten this merged in now but I keep getting this one single error
..\engine\game\main.cc(6) : fatal error C1083: Cannot open include file: 'lua_inc.h': No such file or directory
Now lua_inc.h is located in torque\lib\lua\lua and in my projects setting I added /lib/lua to the Additional Libraries Directories of the Linker/General section of my Projects Settings and yet it still will not find 'lua_inc.h' Can anyone help me figure this one out?
#2
main.obj : error LNK2019: unresolved external symbol _lua_call referenced in function "public: void __thiscall LuaObject::dofile(char const *)" (?dofile@LuaObject@@QAEXPBD@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_loadfile referenced in function "public: void __thiscall LuaObject::dofile(char const *)" (?dofile@LuaObject@@QAEXPBD@Z)
main.obj : error LNK2019: unresolved external symbol _lua_tolstring referenced in function "public: char const * __thiscall LuaObject::docode(char const *)" (?docode@LuaObject@@QAEPBDPBD@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_loadstring referenced in function "public: char const * __thiscall LuaObject::docode(char const *)" (?docode@LuaObject@@QAEPBDPBD@Z)
main.obj : error LNK2019: unresolved external symbol _lua_toboolean referenced in function "public: bool __thiscall LuaObject::getb(char const *)" (?getb@LuaObject@@QAE_NPBD@Z)
main.obj : error LNK2019: unresolved external symbol _lua_gettable referenced in function "public: bool __thiscall LuaObject::getb(char const *)" (?getb@LuaObject@@QAE_NPBD@Z)
main.obj : error LNK2019: unresolved external symbol _lua_pushstring referenced in function "public: bool __thiscall LuaObject::getb(char const *)" (?getb@LuaObject@@QAE_NPBD@Z)
main.obj : error LNK2019: unresolved external symbol _lua_tonumber referenced in function "public: unsigned int __thiscall LuaObject::geti(char const *)" (?geti@LuaObject@@QAEIPBD@Z)
main.obj : error LNK2019: unresolved external symbol _lua_concat referenced in function "public: char const * __thiscall LuaObject::get(char const *)" (?get@LuaObject@@QAEPBDPBD@Z)
main.obj : error LNK2019: unresolved external symbol _lua_insert referenced in function "public: char const * __thiscall LuaObject::get(char const *)" (?get@LuaObject@@QAEPBDPBD@Z)
main.obj : error LNK2019: unresolved external symbol _lua_settable referenced in function "public: void __thiscall LuaObject::set(char const *,char const *)" (?set@LuaObject@@QAEXPBD0@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_checknumber referenced in function "public: int __thiscall game::setb(struct lua_State *)" (?setb@game@@QAEHPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_pushnumber referenced in function "public: int __thiscall game::getb(struct lua_State *)" (?getb@game@@QAEHPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_openlibs referenced in function "bool __cdecl initLibraries(void)" (?initLibraries@@YA_NXZ)
main.obj : error LNK2019: unresolved external symbol _lua_gc referenced in function "bool __cdecl initLibraries(void)" (?initLibraries@@YA_NXZ)
main.obj : error LNK2019: unresolved external symbol _luaL_newstate referenced in function "bool __cdecl initLibraries(void)" (?initLibraries@@YA_NXZ)
main.obj : error LNK2019: unresolved external symbol _lua_close referenced in function "void __cdecl shutdownLibraries(void)" (?shutdownLibraries@@YAXXZ)
main.obj : error LNK2019: unresolved external symbol _lua_pushlightuserdata referenced in function "public: static void __cdecl Lunar::Register(struct lua_State *)" (?Register@?$Lunar@Vgame@@@@SAXPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_setmetatable referenced in function "public: static void __cdecl Lunar::Register(struct lua_State *)" (?Register@?$Lunar@Vgame@@@@SAXPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_pushcclosure referenced in function "public: static void __cdecl Lunar::Register(struct lua_State *)" (?Register@?$Lunar@Vgame@@@@SAXPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_pushvalue referenced in function "public: static void __cdecl Lunar::Register(struct lua_State *)" (?Register@?$Lunar@Vgame@@@@SAXPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_newmetatable referenced in function "public: static void __cdecl Lunar::Register(struct lua_State *)" (?Register@?$Lunar@Vgame@@@@SAXPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_gettop referenced in function "public: static void __cdecl Lunar::Register(struct lua_State *)" (?Register@?$Lunar@Vgame@@@@SAXPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_createtable referenced in function "public: static void __cdecl Lunar::Register(struct lua_State *)" (?Register@?$Lunar@Vgame@@@@SAXPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_touserdata referenced in function "private: static int __cdecl Lunar::thunk(struct lua_State *)" (?thunk@?$Lunar@Vgame@@@@CAHPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_remove referenced in function "private: static int __cdecl Lunar::thunk(struct lua_State *)" (?thunk@?$Lunar@Vgame@@@@CAHPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_type referenced in function "private: static int __cdecl Lunar::gc_T(struct lua_State *)" (?gc_T@?$Lunar@Vgame@@@@CAHPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_getmetafield referenced in function "private: static int __cdecl Lunar::gc_T(struct lua_State *)" (?gc_T@?$Lunar@Vgame@@@@CAHPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_pushfstring referenced in function "private: static int __cdecl Lunar::tostring_T(struct lua_State *)" (?tostring_T@?$Lunar@Vgame@@@@CAHPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_replace referenced in function "public: static int __cdecl Lunar::push(struct lua_State *,class game *,bool)" (?push@?$Lunar@Vgame@@@@SAHPAUlua_State@@PAVgame@@_N@Z)
main.obj : error LNK2019: unresolved external symbol _lua_pushboolean referenced in function "public: static int __cdecl Lunar::push(struct lua_State *,class game *,bool)" (?push@?$Lunar@Vgame@@@@SAHPAUlua_State@@PAVgame@@_N@Z)
main.obj : error LNK2019: unresolved external symbol _lua_checkstack referenced in function "public: static int __cdecl Lunar::push(struct lua_State *,class game *,bool)" (?push@?$Lunar@Vgame@@@@SAHPAUlua_State@@PAVgame@@_N@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_error referenced in function "public: static int __cdecl Lunar::push(struct lua_State *,class game *,bool)" (?push@?$Lunar@Vgame@@@@SAHPAUlua_State@@PAVgame@@_N@Z)
main.obj : error LNK2019: unresolved external symbol _lua_getfield referenced in function "public: static int __cdecl Lunar::push(struct lua_State *,class game *,bool)" (?push@?$Lunar@Vgame@@@@SAHPAUlua_State@@PAVgame@@_N@Z)
main.obj : error LNK2019: unresolved external symbol _lua_pushnil referenced in function "public: static int __cdecl Lunar::push(struct lua_State *,class game *,bool)" (?push@?$Lunar@Vgame@@@@SAHPAUlua_State@@PAVgame@@_N@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_typerror referenced in function "public: static class game * __cdecl Lunar::check(struct lua_State *,int)" (?check@?$Lunar@Vgame@@@@SAPAVgame@@PAUlua_State@@H@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_checkudata referenced in function "public: static class game * __cdecl Lunar::check(struct lua_State *,int)" (?check@?$Lunar@Vgame@@@@SAPAVgame@@PAUlua_State@@H@Z)
main.obj : error LNK2019: unresolved external symbol _lua_newuserdata referenced in function "private: static void * __cdecl Lunar::pushuserdata(struct lua_State *,void *,unsigned int)" (?pushuserdata@?$Lunar@Vgame@@@@CAPAXPAUlua_State@@PAXI@Z)
main.obj : error LNK2019: unresolved external symbol _lua_pushlstring referenced in function "private: static void __cdecl Lunar::weaktable(struct lua_State *,char const *)" (?weaktable@?$Lunar@Vgame@@@@CAXPAUlua_State@@PBD@Z)
04/14/2006 (5:12 pm)
Main.obj : error LNK2019: unresolved external symbol _lua_settop referenced in function "public: void __thiscall LuaObject::dofile(char const *)" (?dofile@LuaObject@@QAEXPBD@Z)main.obj : error LNK2019: unresolved external symbol _lua_call referenced in function "public: void __thiscall LuaObject::dofile(char const *)" (?dofile@LuaObject@@QAEXPBD@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_loadfile referenced in function "public: void __thiscall LuaObject::dofile(char const *)" (?dofile@LuaObject@@QAEXPBD@Z)
main.obj : error LNK2019: unresolved external symbol _lua_tolstring referenced in function "public: char const * __thiscall LuaObject::docode(char const *)" (?docode@LuaObject@@QAEPBDPBD@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_loadstring referenced in function "public: char const * __thiscall LuaObject::docode(char const *)" (?docode@LuaObject@@QAEPBDPBD@Z)
main.obj : error LNK2019: unresolved external symbol _lua_toboolean referenced in function "public: bool __thiscall LuaObject::getb(char const *)" (?getb@LuaObject@@QAE_NPBD@Z)
main.obj : error LNK2019: unresolved external symbol _lua_gettable referenced in function "public: bool __thiscall LuaObject::getb(char const *)" (?getb@LuaObject@@QAE_NPBD@Z)
main.obj : error LNK2019: unresolved external symbol _lua_pushstring referenced in function "public: bool __thiscall LuaObject::getb(char const *)" (?getb@LuaObject@@QAE_NPBD@Z)
main.obj : error LNK2019: unresolved external symbol _lua_tonumber referenced in function "public: unsigned int __thiscall LuaObject::geti(char const *)" (?geti@LuaObject@@QAEIPBD@Z)
main.obj : error LNK2019: unresolved external symbol _lua_concat referenced in function "public: char const * __thiscall LuaObject::get(char const *)" (?get@LuaObject@@QAEPBDPBD@Z)
main.obj : error LNK2019: unresolved external symbol _lua_insert referenced in function "public: char const * __thiscall LuaObject::get(char const *)" (?get@LuaObject@@QAEPBDPBD@Z)
main.obj : error LNK2019: unresolved external symbol _lua_settable referenced in function "public: void __thiscall LuaObject::set(char const *,char const *)" (?set@LuaObject@@QAEXPBD0@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_checknumber referenced in function "public: int __thiscall game::setb(struct lua_State *)" (?setb@game@@QAEHPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_pushnumber referenced in function "public: int __thiscall game::getb(struct lua_State *)" (?getb@game@@QAEHPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_openlibs referenced in function "bool __cdecl initLibraries(void)" (?initLibraries@@YA_NXZ)
main.obj : error LNK2019: unresolved external symbol _lua_gc referenced in function "bool __cdecl initLibraries(void)" (?initLibraries@@YA_NXZ)
main.obj : error LNK2019: unresolved external symbol _luaL_newstate referenced in function "bool __cdecl initLibraries(void)" (?initLibraries@@YA_NXZ)
main.obj : error LNK2019: unresolved external symbol _lua_close referenced in function "void __cdecl shutdownLibraries(void)" (?shutdownLibraries@@YAXXZ)
main.obj : error LNK2019: unresolved external symbol _lua_pushlightuserdata referenced in function "public: static void __cdecl Lunar::Register(struct lua_State *)" (?Register@?$Lunar@Vgame@@@@SAXPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_setmetatable referenced in function "public: static void __cdecl Lunar::Register(struct lua_State *)" (?Register@?$Lunar@Vgame@@@@SAXPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_pushcclosure referenced in function "public: static void __cdecl Lunar::Register(struct lua_State *)" (?Register@?$Lunar@Vgame@@@@SAXPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_pushvalue referenced in function "public: static void __cdecl Lunar::Register(struct lua_State *)" (?Register@?$Lunar@Vgame@@@@SAXPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_newmetatable referenced in function "public: static void __cdecl Lunar::Register(struct lua_State *)" (?Register@?$Lunar@Vgame@@@@SAXPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_gettop referenced in function "public: static void __cdecl Lunar::Register(struct lua_State *)" (?Register@?$Lunar@Vgame@@@@SAXPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_createtable referenced in function "public: static void __cdecl Lunar::Register(struct lua_State *)" (?Register@?$Lunar@Vgame@@@@SAXPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_touserdata referenced in function "private: static int __cdecl Lunar::thunk(struct lua_State *)" (?thunk@?$Lunar@Vgame@@@@CAHPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_remove referenced in function "private: static int __cdecl Lunar::thunk(struct lua_State *)" (?thunk@?$Lunar@Vgame@@@@CAHPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_type referenced in function "private: static int __cdecl Lunar::gc_T(struct lua_State *)" (?gc_T@?$Lunar@Vgame@@@@CAHPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_getmetafield referenced in function "private: static int __cdecl Lunar::gc_T(struct lua_State *)" (?gc_T@?$Lunar@Vgame@@@@CAHPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_pushfstring referenced in function "private: static int __cdecl Lunar::tostring_T(struct lua_State *)" (?tostring_T@?$Lunar@Vgame@@@@CAHPAUlua_State@@@Z)
main.obj : error LNK2019: unresolved external symbol _lua_replace referenced in function "public: static int __cdecl Lunar::push(struct lua_State *,class game *,bool)" (?push@?$Lunar@Vgame@@@@SAHPAUlua_State@@PAVgame@@_N@Z)
main.obj : error LNK2019: unresolved external symbol _lua_pushboolean referenced in function "public: static int __cdecl Lunar::push(struct lua_State *,class game *,bool)" (?push@?$Lunar@Vgame@@@@SAHPAUlua_State@@PAVgame@@_N@Z)
main.obj : error LNK2019: unresolved external symbol _lua_checkstack referenced in function "public: static int __cdecl Lunar::push(struct lua_State *,class game *,bool)" (?push@?$Lunar@Vgame@@@@SAHPAUlua_State@@PAVgame@@_N@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_error referenced in function "public: static int __cdecl Lunar::push(struct lua_State *,class game *,bool)" (?push@?$Lunar@Vgame@@@@SAHPAUlua_State@@PAVgame@@_N@Z)
main.obj : error LNK2019: unresolved external symbol _lua_getfield referenced in function "public: static int __cdecl Lunar::push(struct lua_State *,class game *,bool)" (?push@?$Lunar@Vgame@@@@SAHPAUlua_State@@PAVgame@@_N@Z)
main.obj : error LNK2019: unresolved external symbol _lua_pushnil referenced in function "public: static int __cdecl Lunar::push(struct lua_State *,class game *,bool)" (?push@?$Lunar@Vgame@@@@SAHPAUlua_State@@PAVgame@@_N@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_typerror referenced in function "public: static class game * __cdecl Lunar::check(struct lua_State *,int)" (?check@?$Lunar@Vgame@@@@SAPAVgame@@PAUlua_State@@H@Z)
main.obj : error LNK2019: unresolved external symbol _luaL_checkudata referenced in function "public: static class game * __cdecl Lunar::check(struct lua_State *,int)" (?check@?$Lunar@Vgame@@@@SAPAVgame@@PAUlua_State@@H@Z)
main.obj : error LNK2019: unresolved external symbol _lua_newuserdata referenced in function "private: static void * __cdecl Lunar::pushuserdata(struct lua_State *,void *,unsigned int)" (?pushuserdata@?$Lunar@Vgame@@@@CAPAXPAUlua_State@@PAXI@Z)
main.obj : error LNK2019: unresolved external symbol _lua_pushlstring referenced in function "private: static void __cdecl Lunar::weaktable(struct lua_State *,char const *)" (?weaktable@?$Lunar@Vgame@@@@CAXPAUlua_State@@PBD@Z)
#3
You should check your libraries. I don't know your platform, but in some cases and for some compilers, the order in which you include your libraries is also a determining factor. Rule of thumb here is that you put the library with the most dependencies up front, so that the linker can fill in the blanks when he comes across the other libaries.
04/17/2006 (7:17 am)
These look to me like you don't have a Lua library in your project. The linker is trying to find the references to these functions, but it can't find an implementation for them.You should check your libraries. I don't know your platform, but in some cases and for some compilers, the order in which you include your libraries is also a determining factor. Rule of thumb here is that you put the library with the most dependencies up front, so that the linker can fill in the blanks when he comes across the other libaries.
#4
04/17/2006 (7:48 am)
Using Windows and Visual Studio Professional 2005, I followed your advice and checked the libs and I had indeed not added the Lua lib to my project now all compiles without a hitch. thanks so much for pointing me in the right direction.
Torque Owner Michael Branin
Default Studio Name
f:\sdk\lib\lua\lua\src\loadlib.c(120) : error C2664: 'FormatMessageW' : cannot convert parameter 5 from 'char [128]' to 'LPWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
f:\sdk\lib\lua\lua\src\loadlib.c(132) : error C2664: 'LoadLibraryW' : cannot convert parameter 1 from 'const char *' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
From my understanding these are unicode errors and in the resources comments section Joe Rassi says this
What compiler are you using? It builds fine for me in MSVC2003, with or without Unicode. Those are unicode related errors. You can try to rename any of those function calls to "FormatMessageA" and "LoadLibraryA". Every windows function have an "A" (ansi) and a "W" (unicode) version. I think Lua needs the "A" versions..
Now I do what he says to do there and I go from those 2 errors to 41 errors listed here