{"action":"opened","issue":{"url":"https://api.github.com/repos/jeremyong/Selene/issues/138","labels_url":"https://api.github.com/repos/jeremyong/Selene/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/jeremyong/Selene/issues/138/comments","events_url":"https://api.github.com/repos/jeremyong/Selene/issues/138/events","html_url":"https://github.com/jeremyong/Selene/issues/138","id":121685745,"number":138,"title":"Compilation Errors","user":{"login":"AndrewChicco","id":16254279,"avatar_url":"https://avatars.githubusercontent.com/u/16254279?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewChicco","html_url":"https://github.com/AndrewChicco","followers_url":"https://api.github.com/users/AndrewChicco/followers","following_url":"https://api.github.com/users/AndrewChicco/following{/other_user}","gists_url":"https://api.github.com/users/AndrewChicco/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewChicco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewChicco/subscriptions","organizations_url":"https://api.github.com/users/AndrewChicco/orgs","repos_url":"https://api.github.com/users/AndrewChicco/repos","events_url":"https://api.github.com/users/AndrewChicco/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewChicco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-11T10:59:38Z","updated_at":"2015-12-11T10:59:38Z","closed_at":null,"body":"Hi,\r\nI'm getting some major compilation errors attempting to compile a very simple program\r\n(using Ubuntu 15.x with G++ 4.9.2).\r\n\r\nThese problems appeared when I added in all the selene specific code in the main function.\r\n\r\nCan someone let me know if I'm doing something terribly wrong.\r\n\r\nPlease excuse my ignorance if I've done something very obviously wrong.\r\n\r\nThanks,\r\nAndrew\r\n\r\n#include <selene.h>\r\n#include <iostream>\r\n#include <cassert>\r\n\r\nusing namespace std;\r\nusing namespace sel;\r\n\r\nint main()\r\n{\r\n   State state;\r\n   state.Load(\"./test.lua\");\r\n   assert(state[\"foo\"] == 4);\r\n   assert(state[\"bar\"][3] == \"hi\");\r\n   assert(state[\"bar\"][\"key\"] == \"there\");\r\n\r\n   // basic checking\r\n   cout << \"Hello world!\" << endl;\r\n   return 0;\r\n}\r\n\r\n-- test.lua\r\nfoo = 4\r\nbar = {}\r\nbar[3] = \"hi\"\r\nbar[\"key\"] = \"there\"\r\n\r\nerrors\r\n\r\n-------------- Clean: Debug in LUATest (compiler: GNU GCC Compiler)---------------\r\n\r\nCleaned \"LUATest - Debug\"\r\n\r\n-------------- Build: Debug in LUATest (compiler: GNU GCC Compiler)---------------\r\n\r\ng++ -Wall -fexceptions -std=c++11 -I/usr/include/lua5.2 -I/usr/include/selene -c /home/andrew/code/LUATest/LUATest/main.cpp -o obj/Debug/main.o\r\ng++  -o bin/Debug/LUATest obj/Debug/main.o   \r\nobj/Debug/main.o: In function `sel::MetatableRegistry::detail::_create_table_in_registry(lua_State*, std::string const&)':\r\nmain.cpp:(.text+0x100): undefined reference to `lua_pushlstring'\r\nmain.cpp:(.text+0x112): undefined reference to `lua_createtable'\r\nmain.cpp:(.text+0x125): undefined reference to `lua_settable'\r\nobj/Debug/main.o: In function `sel::detail::_get(sel::detail::_id<int>, lua_State*, int)':\r\nmain.cpp:(.text._ZN3sel6detail4_getENS0_3_idIiEEP9lua_Statei[_ZN3sel6detail4_getENS0_3_idIiEEP9lua_Statei]+0x12): undefined reference to `lua_tointegerx'\r\nobj/Debug/main.o: In function `sel::detail::_get(sel::detail::_id<std::string>, lua_State*, int)':\r\nmain.cpp:(.text._ZN3sel6detail4_getENS0_3_idISsEEP9lua_Statei[_ZN3sel6detail4_getENS0_3_idISsEEP9lua_Statei]+0x2c): undefined reference to `lua_tolstring'\r\nobj/Debug/main.o: In function `sel::detail::_push(lua_State*, int)':\r\nmain.cpp:(.text._ZN3sel6detail5_pushEP9lua_Statei[_ZN3sel6detail5_pushEP9lua_Statei]+0x10): undefined reference to `lua_pushinteger'\r\nobj/Debug/main.o: In function `sel::detail::_push(lua_State*, std::string const&)':\r\nmain.cpp:(.text._ZN3sel6detail5_pushEP9lua_StateRKSs[_ZN3sel6detail5_pushEP9lua_StateRKSs]+0x2e): undefined reference to `lua_pushlstring'\r\nobj/Debug/main.o: In function `sel::test_stored_exception(lua_State*)':\r\nmain.cpp:(.text._ZN3sel21test_stored_exceptionEP9lua_State[_ZN3sel21test_stored_exceptionEP9lua_State]+0xf): undefined reference to `lua_isuserdata'\r\nmain.cpp:(.text._ZN3sel21test_stored_exceptionEP9lua_State[_ZN3sel21test_stored_exceptionEP9lua_State]+0x3a): undefined reference to `luaL_testudata'\r\nobj/Debug/main.o: In function `sel::ResetStackOnScopeExit::ResetStackOnScopeExit(lua_State*)':\r\nmain.cpp:(.text._ZN3sel21ResetStackOnScopeExitC2EP9lua_State[_ZN3sel21ResetStackOnScopeExitC5EP9lua_State]+0x18): undefined reference to `lua_gettop'\r\nobj/Debug/main.o: In function `sel::ResetStackOnScopeExit::~ResetStackOnScopeExit()':\r\nmain.cpp:(.text._ZN3sel21ResetStackOnScopeExitD2Ev[_ZN3sel21ResetStackOnScopeExitD5Ev]+0x20): undefined reference to `lua_settop'\r\nobj/Debug/main.o: In function `sel::detail::LuaRefDeleter::operator()(int*) const':\r\nmain.cpp:(.text._ZNK3sel6detail13LuaRefDeleterclEPi[_ZNK3sel6detail13LuaRefDeleterclEPi]+0x1b): undefined reference to `luaL_unref'\r\nobj/Debug/main.o: In function `sel::LuaRef::Push(lua_State*) const':\r\nmain.cpp:(.text._ZNK3sel6LuaRef4PushEP9lua_State[_ZNK3sel6LuaRef4PushEP9lua_State]+0x24): undefined reference to `lua_rawgeti'\r\nobj/Debug/main.o: In function `sel::Traceback(lua_State*)':\r\nmain.cpp:(.text._ZN3sel9TracebackEP9lua_State[_ZN3sel9TracebackEP9lua_State]+0x16): undefined reference to `lua_type'\r\nmain.cpp:(.text._ZN3sel9TracebackEP9lua_State[_ZN3sel9TracebackEP9lua_State]+0x31): undefined reference to `lua_tolstring'\r\nmain.cpp:(.text._ZN3sel9TracebackEP9lua_State[_ZN3sel9TracebackEP9lua_State]+0x52): undefined reference to `lua_pushstring'\r\nmain.cpp:(.text._ZN3sel9TracebackEP9lua_State[_ZN3sel9TracebackEP9lua_State]+0x65): undefined reference to `lua_getglobal'\r\nmain.cpp:(.text._ZN3sel9TracebackEP9lua_State[_ZN3sel9TracebackEP9lua_State]+0x7a): undefined reference to `lua_getfield'\r\nmain.cpp:(.text._ZN3sel9TracebackEP9lua_State[_ZN3sel9TracebackEP9lua_State]+0x8a): undefined reference to `lua_pushvalue'\r\nmain.cpp:(.text._ZN3sel9TracebackEP9lua_State[_ZN3sel9TracebackEP9lua_State]+0x9a): undefined reference to `lua_pushinteger'\r\nmain.cpp:(.text._ZN3sel9TracebackEP9lua_State[_ZN3sel9TracebackEP9lua_State]+0xb0): undefined reference to `lua_callk'\r\nobj/Debug/main.o: In function `sel::SetErrorHandler(lua_State*)':\r\nmain.cpp:(.text._ZN3sel15SetErrorHandlerEP9lua_State[_ZN3sel15SetErrorHandlerEP9lua_State]+0x14): undefined reference to `lua_pushcclosure'\r\nmain.cpp:(.text._ZN3sel15SetErrorHandlerEP9lua_State[_ZN3sel15SetErrorHandlerEP9lua_State]+0x22): undefined reference to `lua_gettop'\r\nobj/Debug/main.o: In function `sel::Selector::_get(sel::LuaRef) const':\r\nmain.cpp:(.text._ZNK3sel8Selector4_getENS_6LuaRefE[_ZNK3sel8Selector4_getENS_6LuaRefE]+0x26): undefined reference to `lua_gettable'\r\nmain.cpp:(.text._ZNK3sel8Selector4_getENS_6LuaRefE[_ZNK3sel8Selector4_getENS_6LuaRefE]+0x39): undefined reference to `lua_absindex'\r\nmain.cpp:(.text._ZNK3sel8Selector4_getENS_6LuaRefE[_ZNK3sel8Selector4_getENS_6LuaRefE]+0x4d): undefined reference to `lua_remove'\r\nobj/Debug/main.o: In function `sel::Selector::_check_create_table() const::{lambda()#1}::operator()() const':\r\nmain.cpp:(.text._ZZNK3sel8Selector19_check_create_tableEvENKUlvE_clEv[_ZZNK3sel8Selector19_check_create_tableEvENKUlvE_clEv]+0x16): undefined reference to `lua_createtable'\r\nobj/Debug/main.o: In function `sel::Selector::_check_create_table() const':\r\nmain.cpp:(.text._ZNK3sel8Selector19_check_create_tableEv[_ZNK3sel8Selector19_check_create_tableEv]+0x55): undefined reference to `lua_type'\r\nmain.cpp:(.text._ZNK3sel8Selector19_check_create_tableEv[_ZNK3sel8Selector19_check_create_tableEv]+0x72): undefined reference to `lua_settop'\r\nobj/Debug/main.o: In function `sel::Selector::_traverse() const':\r\nmain.cpp:(.text._ZNK3sel8Selector9_traverseEv[_ZNK3sel8Selector9_traverseEv]+0x29): undefined reference to `lua_rawgeti'\r\nobj/Debug/main.o: In function `sel::Selector::_evaluate_function_call(int) const':\r\nmain.cpp:(.text._ZNK3sel8Selector23_evaluate_function_callEi[_ZNK3sel8Selector23_evaluate_function_callEi]+0x74): undefined reference to `lua_pushvalue'\r\nmain.cpp:(.text._ZNK3sel8Selector23_evaluate_function_callEi[_ZNK3sel8Selector23_evaluate_function_callEi]+0x8b): undefined reference to `lua_copy'\r\nmain.cpp:(.text._ZNK3sel8Selector23_evaluate_function_callEi[_ZNK3sel8Selector23_evaluate_function_callEi]+0x9f): undefined reference to `lua_replace'\r\nmain.cpp:(.text._ZNK3sel8Selector23_evaluate_function_callEi[_ZNK3sel8Selector23_evaluate_function_callEi]+0x14e): undefined reference to `lua_pcallk'\r\nmain.cpp:(.text._ZNK3sel8Selector23_evaluate_function_callEi[_ZNK3sel8Selector23_evaluate_function_callEi]+0x169): undefined reference to `lua_remove'\r\nobj/Debug/main.o: In function `sel::State::State(bool)':\r\nmain.cpp:(.text._ZN3sel5StateC2Eb[_ZN3sel5StateC5Eb]+0x5f): undefined reference to `luaL_newstate'\r\nmain.cpp:(.text._ZN3sel5StateC2Eb[_ZN3sel5StateC5Eb]+0xa6): undefined reference to `luaL_openlibs'\r\nobj/Debug/main.o: In function `sel::State::~State()':\r\nmain.cpp:(.text._ZN3sel5StateD2Ev[_ZN3sel5StateD5Ev]+0x32): undefined reference to `lua_close'\r\nobj/Debug/main.o: In function `sel::State::Load(std::string const&)':\r\nmain.cpp:(.text._ZN3sel5State4LoadERKSs[_ZN3sel5State4LoadERKSs]+0x51): undefined reference to `luaL_loadfilex'\r\nmain.cpp:(.text._ZN3sel5State4LoadERKSs[_ZN3sel5State4LoadERKSs]+0x84): undefined reference to `lua_tolstring'\r\nmain.cpp:(.text._ZN3sel5State4LoadERKSs[_ZN3sel5State4LoadERKSs]+0x163): undefined reference to `lua_tolstring'\r\nmain.cpp:(.text._ZN3sel5State4LoadERKSs[_ZN3sel5State4LoadERKSs]+0x243): undefined reference to `lua_pcallk'\r\nmain.cpp:(.text._ZN3sel5State4LoadERKSs[_ZN3sel5State4LoadERKSs]+0x26b): undefined reference to `lua_tolstring'\r\nobj/Debug/main.o: In function `sel::State::ForceGC()':\r\nmain.cpp:(.text._ZN3sel5State7ForceGCEv[_ZN3sel5State7ForceGCEv]+0x14): undefined reference to `lua_gc'\r\nobj/Debug/main.o: In function `sel::LuaRef sel::make_Ref<std::string const&>(lua_State*, std::string const&)':\r\nmain.cpp:(.text._ZN3sel8make_RefIRKSsEENS_6LuaRefEP9lua_StateOT_[_ZN3sel8make_RefIRKSsEENS_6LuaRefEP9lua_StateOT_]+0x2f): undefined reference to `luaL_ref'\r\nobj/Debug/main.o: In function `void sel::Selector::_put<sel::Selector::_check_create_table() const::{lambda()#1}>(sel::Selector::_check_create_table() const::{lambda()#1}) const':\r\nmain.cpp:(.text._ZNK3sel8Selector4_putIZNKS0_19_check_create_tableEvEUlvE_EEvT_[_ZNK3sel8Selector4_putIZNKS0_19_check_create_tableEvEUlvE_EEvT_]+0x39): undefined reference to `lua_settable'\r\nmain.cpp:(.text._ZNK3sel8Selector4_putIZNKS0_19_check_create_tableEvEUlvE_EEvT_[_ZNK3sel8Selector4_putIZNKS0_19_check_create_tableEvEUlvE_EEvT_]+0x4c): undefined reference to `lua_settop'\r\nobj/Debug/main.o: In function `int sel::detail::_pop<int>(sel::detail::_id<int>, lua_State*)':\r\nmain.cpp:(.text._ZN3sel6detail4_popIiEET_NS0_3_idIS2_EEP9lua_State[_ZN3sel6detail4_popIiEET_NS0_3_idIS2_EEP9lua_State]+0x23): undefined reference to `lua_settop'\r\nobj/Debug/main.o: In function `std::string sel::detail::_pop<std::string>(sel::detail::_id<std::string>, lua_State*)':\r\nmain.cpp:(.text._ZN3sel6detail4_popISsEET_NS0_3_idIS2_EEP9lua_State[_ZN3sel6detail4_popISsEET_NS0_3_idIS2_EEP9lua_State]+0x39): undefined reference to `lua_settop'\r\nobj/Debug/main.o: In function `sel::LuaRef sel::make_Ref<int const&>(lua_State*, int const&)':\r\nmain.cpp:(.text._ZN3sel8make_RefIRKiEENS_6LuaRefEP9lua_StateOT_[_ZN3sel8make_RefIRKiEENS_6LuaRefEP9lua_StateOT_]+0x31): undefined reference to `luaL_ref'\r\nProcess terminated with status 1 (0 minute(s), 6 second(s))\r\n50 error(s), 0 warning(s) (0 minute(s), 6 second(s))\r\n \r\n"}}