I am trying to embed luajit into a source game I am working on (for once lua is NOT going into a sandbox style game as much) I have added the lib to the additional depedencies, and yet I still get the following errors:
[cpp]
3>------ Build started: Project: Client SDK, Configuration: Release Win32 ------
3> client_scratch-2005.vcxproj -> C:\DeRP\src\game\client\.\Release_sdk\client.dll
2> Creating library .\Release_sdk\server.lib and object .\Release_sdk\server.exp
2>lua.obj : error LNK2019: unresolved external symbol "void __cdecl lua_close(struct lua_State *)" (?lua_close@@YAXPAUlua_State@@@Z) referenced in function "void __cdecl LuaTest_f(class CCommand const &)" (?LuaTest_f@@YAXABVCCommand@@@Z)
2>lua.obj : error LNK2019: unresolved external symbol "void __cdecl lua_settop(struct lua_State *,int)" (?lua_settop@@YAXPAUlua_State@@H@Z) referenced in function "void __cdecl LuaTest_f(class CCommand const &)" (?LuaTest_f@@YAXABVCCommand@@@Z)
2>lua.obj : error LNK2019: unresolved external symbol "double __cdecl lua_tonumber(struct lua_State *,int)" (?lua_tonumber@@YANPAUlua_State@@H@Z) referenced in function "void __cdecl LuaTest_f(class CCommand const &)" (?LuaTest_f@@YAXABVCCommand@@@Z)
2>lua.obj : error LNK2019: unresolved external symbol "int __cdecl lua_pcall(struct lua_State *,int,int,int)" (?lua_pcall@@YAHPAUlua_State@@HHH@Z) referenced in function "void __cdecl LuaTest_f(class CCommand const &)" (?LuaTest_f@@YAXABVCCommand@@@Z)
2>lua.obj : error LNK2019: unresolved external symbol "void __cdecl lua_setfield(struct lua_State *,int,char const *)" (?lua_setfield@@YAXPAUlua_State@@HPBD@Z) referenced in function "void __cdecl LuaTest_f(class CCommand const &)" (?LuaTest_f@@YAXABVCCommand@@@Z)
2>lua.obj : error LNK2019: unresolved external symbol "void __cdecl lua_rawset(struct lua_State *,int)" (?lua_rawset@@YAXPAUlua_State@@H@Z) referenced in function "void __cdecl LuaTest_f(class CCommand const &)" (?LuaTest_f@@YAXABVCCommand@@@Z)
2>lua.obj : error LNK2019: unresolved external symbol "void __cdecl lua_pushnumber(struct lua_State *,double)" (?lua_pushnumber@@YAXPAUlua_State@@N@Z) referenced in function "void __cdecl LuaTest_f(class CCommand const &)" (?LuaTest_f@@YAXABVCCommand@@@Z)
2>lua.obj : error LNK2019: unresolved external symbol "void __cdecl lua_createtable(struct lua_State *,int,int)" (?lua_createtable@@YAXPAUlua_State@@HH@Z) referenced in function "void __cdecl LuaTest_f(class CCommand const &)" (?LuaTest_f@@YAXABVCCommand@@@Z)
2>lua.obj : error LNK2019: unresolved external symbol "char const * __cdecl lua_tolstring(struct lua_State *,int,unsigned int *)" (?lua_tolstring@@YAPBDPAUlua_State@@HPAI@Z) referenced in function "void __cdecl LuaTest_f(class CCommand const &)" (?LuaTest_f@@YAXABVCCommand@@@Z)
2>lua.obj : error LNK2019: unresolved external symbol "int __cdecl luaL_loadfile(struct lua_State *,char const *)" (?luaL_loadfile@@YAHPAUlua_State@@PBD@Z) referenced in function "void __cdecl LuaTest_f(class CCommand const &)" (?LuaTest_f@@YAXABVCCommand@@@Z)
2>lua.obj : error LNK2019: unresolved external symbol "struct lua_State * __cdecl luaL_newstate(void)" (?luaL_newstate@@YAPAUlua_State@@XZ) referenced in function "void __cdecl LuaTest_f(class CCommand const &)" (?LuaTest_f@@YAXABVCCommand@@@Z)
2>.\Release_sdk\Server.dll : fatal error LNK1120: 11 unresolved externals
[/cpp]
Can anyone tell me if i have missed something major?
:> you like lua dont you nekosune
I am trying to embed it basically to use as simple way to have new items in the game am working on, I am used to it hence why trying to do so. I made a new thread so as to not muck up WAYWO
[editline]15th February 2012[/editline]
turns out I forgot to use extern "C" to enclose the headers.
[QUOTE=nekosune;34706132]turns out I forgot to use extern "C" to enclose the headers.[/QUOTE]
This always throws me off because I never expect it.
If you're using the standard Lua 5.1.4 distribution, just use lua.hpp, which does this for you.
[QUOTE=amcfaggot;34706456]This always throws me off because I never expect it.
If you're using the standard Lua 5.1.4 distribution, just use lua.hpp, which does this for you.[/QUOTE]
As stated in WAYWO I Am using luajit also, I was unsure because of the trouble about it that happeend a while back, but decided after asking, to give it a try.
[editline]15th February 2012[/editline]
But seems since luajit also has this, thankyou!
Sorry, you need to Log In to post a reply to this thread.