#include <iostream>
#include <conio.h>
using namespace std;
extern "C"
{
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
}
#include <luabind\luabind.hpp>
void test(void)
{
printf("I am a test!\n");
}
void main(void)
{
lua_State* state = lua_open();
luabind::open(state);
// This appears to have something to do with the linker errors. Without these lines it compiles file!
luabind::module(state)
[
luabind::def("test", test)
];
int result = luaL_dofile(state, "test.lua");
printf("Result: %d\n", result);
lua_close(state);
_getch();
}
1>main.obj : error LNK2019: unresolved external symbol "int __cdecl luabind::detail::ref(struct lua_State *)" (?ref@detail@luabind@@YAHPAUlua_State@@@Z) referenced in function "public: __thiscall luabind::handle::handle(struct lua_State *,int)" (??0handle@luabind@@QAE@PAUlua_State@@H@Z)
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl luabind::detail::unref(struct lua_State *,int)" (?unref@detail@luabind@@YAXPAUlua_State@@H@Z) referenced in function "public: __thiscall luabind::handle::~handle(void)" (??1handle@luabind@@QAE@XZ)
1>main.obj : error LNK2019: unresolved external symbol "class luabind::adl::object __cdecl luabind::detail::make_function_aux(struct lua_State *,int,class boost::function1<int,struct lua_State *> const &,class boost::function1<int,struct lua_State *> const &,class boost::function2<int,struct lua_State *,char const *> const &)" (?make_function_aux@detail@luabind@@YA?AVobject@adl@2@PAUlua_State@@HABV?$function1@HPAUlua_State@@@boost@@1ABV?$function2@HPAUlua_State@@PBD@7@@Z) referenced in function "class luabind::adl::object __cdecl luabind::make_function<void (__cdecl*)(void),struct boost::mpl::vector1<void>,struct luabind::detail::null_type>(struct lua_State *,void (__cdecl*)(void),struct boost::mpl::vector1<void>,struct luabind::detail::null_type)"
I have "lua51.lib" and "luabind_d.lib" linked in.
Any help would be greatly appreciated.