[EDIT] Solved by mvBarracuda, thanks a million!!!! He compiled it into a .lib that works with Microsoft Visual Studio 9.0, scroll down for download link.
The situation: I got lua-5.1.3 working in my project but when i tried to get luabind-0.7 working with it, it just gives me errors and I can't fix them.
LuaInterpreter.h
extern "C"
{
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
}
#include <luabind/luabind.hpp>
class LuaInterpreter
{
public:
LuaInterpreter();
void Test();
};
LuaInterpreter.cpp
#include <iostream>
#include "LuaInterpreter.h"
LuaInterpreter::LuaInterpreter()
{
}
void PrintSomething()
{
std::cout << "I really want to see this message..." << std::endl;
}
void LuaInterpreter::Test()
{
lua_State* interpreter = lua_open();
luabind::open(interpreter);
luabind::module(interpreter) [
luabind::def("PrintSomething", PrintSomething)
];
luaL_dostring(interpreter, "PrintSomething()\n");
lua_close(interpreter);
}
The Errors:
LuaInterpreter.obj : error LNK2019: unresolved external symbol "public: __thiscall luabind::scope::~scope(void)" (??1scope@luabind@@QAE@XZ) referenced in function __unwindfunclet$?Test@LuaInterpreter@@QAEXXZ$0
LuaInterpreter.obj : error LNK2019: unresolved external symbol "public: void __thiscall luabind::module_::operator[](struct luabind::scope)" (??Amodule_@luabind@@QAEXUscope@1@@Z) referenced in function "public: void __thiscall LuaInterpreter::Test(void)" (?Test@LuaInterpreter@@QAEXXZ)
LuaInterpreter.obj : error LNK2019: unresolved external symbol "void __cdecl luabind::open(struct lua_State *)" (?open@luabind@@YAXPAUlua_State@@@Z) referenced in function "public: void __thiscall LuaInterpreter::Test(void)" (?Test@LuaInterpreter@@QAEXXZ)
LuaInterpreter.obj : error LNK2019: unresolved external symbol "public: __thiscall luabind::module_::module_(struct lua_State *,char const *)" (??0module_@luabind@@QAE@PAUlua_State@@PBD@Z) referenced in function "class luabind::module_ __cdecl luabind::module(struct lua_State *,char const *)" (?module@luabind@@YA?AVmodule_@1@PAUlua_State@@PBD@Z)
LuaInterpreter.obj : error LNK2019: unresolved external symbol "public: __thiscall luabind::scope::scope(struct luabind::scope const &)" (??0scope@luabind@@QAE@ABU01@@Z) referenced in function "struct luabind::scope __cdecl luabind::def<void (__cdecl*)(void)>(char const *,void (__cdecl*)(void))" (??$def@P6AXXZ@luabind@@YA?AUscope@0@PBDP6AXXZ@Z)
LuaInterpreter.obj : error LNK2019: unresolved external symbol "public: __thiscall luabind::scope::scope(class std::auto_ptr<struct luabind::detail::registration>)" (??0scope@luabind@@QAE@V?$auto_ptr@Uregistration@detail@luabind@@@std@@@Z) referenced in function "struct luabind::scope __cdecl luabind::def<void (__cdecl*)(void)>(char const *,void (__cdecl*)(void))" (??$def@P6AXXZ@luabind@@YA?AUscope@0@PBDP6AXXZ@Z)
LuaInterpreter.obj : error LNK2019: unresolved external symbol "public: __thiscall luabind::detail::registration::registration(void)" (??0registration@detail@luabind@@QAE@XZ) referenced in function "public: __thiscall luabind::detail::function_commiter<void (__cdecl*)(void),struct luabind::detail::null_type>::function_commiter<void (__cdecl*)(void),struct luabind::detail::null_type>(char const *,void (__cdecl*)(void),struct luabind::detail::null_type const &)" (??0?$function_commiter@P6AXXZUnull_type@detail@luabind@@@detail@luabind@@QAE@PBDP6AXXZABUnull_type@12@@Z)
LuaInterpreter.obj : error LNK2019: unresolved external symbol "public: void __thiscall luabind::detail::free_functions::function_rep::add_overload(struct luabind::detail::free_functions::overload_rep const &)" (?add_overload@function_rep@free_functions@detail@luabind@@QAEXABUoverload_rep@234@@Z) referenced in function "public: virtual void __thiscall luabind::detail::function_commiter<void (__cdecl*)(void),struct luabind::detail::null_type>::register_(struct lua_State *)const " (?register_@?$function_commiter@P6AXXZUnull_type@detail@luabind@@@detail@luabind@@UBEXPAUlua_State@@@Z)
LuaInterpreter.obj : error LNK2019: unresolved external symbol "int __cdecl luabind::detail::free_functions::function_dispatcher(struct lua_State *)" (?function_dispatcher@free_functions@detail@luabind@@YAHPAUlua_State@@@Z) referenced in function "public: virtual void __thiscall luabind::detail::function_commiter<void (__cdecl*)(void),struct luabind::detail::null_type>::register_(struct lua_State *)const " (?register_@?$function_commiter@P6AXXZUnull_type@detail@luabind@@@detail@luabind@@UBEXPAUlua_State@@@Z)
LuaInterpreter.obj : error LNK2019: unresolved external symbol "public: static struct luabind::detail::class_registry * __cdecl luabind::detail::class_registry::get_registry(struct lua_State *)" (?get_registry@class_registry@detail@luabind@@SAPAU123@PAUlua_State@@@Z) referenced in function "public: virtual void __thiscall luabind::detail::function_commiter<void (__cdecl*)(void),struct luabind::detail::null_type>::register_(struct lua_State *)const " (?register_@?$function_commiter@P6AXXZUnull_type@detail@luabind@@@detail@luabind@@UBEXPAUlua_State@@@Z)
LuaInterpreter.obj : error LNK2019: unresolved external symbol "int __cdecl luabind::detail::ref(struct lua_State *)" (?ref@detail@luabind@@YAHPAUlua_State@@@Z) referenced in function "public: virtual void __thiscall luabind::detail::function_commiter<void (__cdecl*)(void),struct luabind::detail::null_type>::register_(struct lua_State *)const " (?register_@?$function_commiter@P6AXXZUnull_type@detail@luabind@@@detail@luabind@@UBEXPAUlua_State@@@Z)
LuaInterpreter.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall luabind::detail::registration::~registration(void)" (??1registration@detail@luabind@@UAE@XZ) referenced in function "public: virtual __thiscall luabind::detail::function_commiter<void (__cdecl*)(void),struct luabind::detail::null_type>::~function_commiter<void (__cdecl*)(void),struct luabind::detail::null_type>(void)" (??1?$function_commiter@P6AXXZUnull_type@detail@luabind@@@detail@luabind@@UAE@XZ)
My first guess to why this is happening is because I don't have the luabind-0.7.dll or luabind-0.7.lib but if that is the problem I can't find them. I did come across luabind.x86.release however but putting it into my compilers lib folder and linking it gave me the error: LINK : fatal error LNK1181: cannot open input file 'luabind.x86.release'. I'm using Microsoft Visual Studio 9.0 if that means anything.
Any help would be greatly appreciated!
[Edited by - Tenac on June 25, 2008 12:28:32 AM]