我有这段代码(文件 luascript.cpp):
bool LuaInterface::initState()
{
m_luaState = luaL_newstate();
if(!m_luaState)
return false;
luaL_openlibs(m_luaState);
#ifdef __LUAJIT__
luaJIT_setmode(m_luaState, 0, LUAJIT_MODE_ENGINE | LUAJIT_MODE_ON);
#endif
registerFunctions();
if(!loadDirectory(getFilePath(FILE_TYPE_OTHER, "lib/"), false, true))
std::clog << "[Warning - LuaInterface::initState] Cannot load " << getFilePath(FILE_TYPE_OTHER, "lib/") << std::endl;
lua_newtable(m_luaState);
lua_setfield(m_luaState, LUA_REGISTRYINDEX, "EVENTS");
m_runningEvent = EVENT_ID_USER;
return true;
}
声明(文件 luajit.h):
LUA_API int luaJIT_setmode(lua_State *L, int idx, int mode);
错误是:
1>luascript.obj : error LNK2019: unresolved external symbol _luaJIT_setmode referenced in function "public: virtual bool __thiscall LuaInterface::initState(void)" (?initState@LuaInterface@@UAE_NXZ)
1>C:\Users\GUIAKI\Documents\trunk.r5918\vc10\Debug\tfs.exe : fatal error LNK1120: 1 unresolved externals
我该如何解决?