Author Topic: Build error: lua problems on linux  (Read 3749 times)

NoQ

  • Guest
Build error: lua problems on linux
« on: 31 January 2013, 07:06:42 »
Just tried compiling the game from svn :) I have lua-5.1.5 and lua-5.2.1 installed on my archlinux system, yet linking the megaglest binary fails with the following error:

Code: [Select]
[ 25%] Built target streflop
[ 65%] Built target libmegaglest
Linking CXX executable ../../../mk/linux/megaglest
../shared_lib/liblibmegaglest.a(lua_script.cpp.o): In function `Shared::Lua::LuaScript::LuaScript()':
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:68: undefined reference to `lua_getglobal'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:78: undefined reference to `lua_getglobal'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:91: undefined reference to `lua_setglobal'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:93: undefined reference to `lua_setglobal'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:95: undefined reference to `lua_setglobal'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:97: undefined reference to `lua_setglobal'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:99: undefined reference to `lua_setglobal'
../shared_lib/liblibmegaglest.a(lua_script.cpp.o):/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:101: more undefined references to `lua_setglobal' follow
../shared_lib/liblibmegaglest.a(lua_script.cpp.o): In function `Shared::Lua::LuaScript::runCode(std::string)':
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:528: undefined reference to `lua_pcallk'
../shared_lib/liblibmegaglest.a(lua_script.cpp.o): In function `Shared::Lua::LuaArguments::getStackText() const':
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:997: undefined reference to `lua_rawlen'
../shared_lib/liblibmegaglest.a(lua_script.cpp.o): In function `Shared::Lua::LuaArguments::getVec4i(int) const':
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:890: undefined reference to `lua_rawlen'
../shared_lib/liblibmegaglest.a(lua_script.cpp.o): In function `Shared::Lua::LuaArguments::getVec2i(int) const':
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:849: undefined reference to `lua_rawlen'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:863: undefined reference to `lua_tointegerx'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:872: undefined reference to `lua_tointegerx'
../shared_lib/liblibmegaglest.a(lua_script.cpp.o): In function `Shared::Lua::LuaArguments::getVec4f(int) const':
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:761: undefined reference to `lua_rawlen'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:775: undefined reference to `lua_tonumberx'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:784: undefined reference to `lua_tonumberx'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:793: undefined reference to `lua_tonumberx'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:800: undefined reference to `lua_tonumberx'
../shared_lib/liblibmegaglest.a(lua_script.cpp.o): In function `Shared::Lua::LuaArguments::getVec3f(int) const':
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:713: undefined reference to `lua_rawlen'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:727: undefined reference to `lua_tonumberx'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:736: undefined reference to `lua_tonumberx'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:745: undefined reference to `lua_tonumberx'
../shared_lib/liblibmegaglest.a(lua_script.cpp.o): In function `Shared::Lua::LuaArguments::getVec2f(int) const':
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:672: undefined reference to `lua_rawlen'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:686: undefined reference to `lua_tonumberx'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:695: undefined reference to `lua_tonumberx'
../shared_lib/liblibmegaglest.a(lua_script.cpp.o): In function `Shared::Lua::LuaScript::registerFunction(int (*)(lua_State*), std::string)':
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:602: undefined reference to `lua_setglobal'
../shared_lib/liblibmegaglest.a(lua_script.cpp.o): In function `Shared::Lua::LuaScript::endCall()':
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:584: undefined reference to `lua_pcallk'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:592: undefined reference to `lua_pcallk'
../shared_lib/liblibmegaglest.a(lua_script.cpp.o): In function `Shared::Lua::LuaScript::beginCall(std::string)':
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:548: undefined reference to `lua_getglobal'
../shared_lib/liblibmegaglest.a(lua_script.cpp.o): In function `Shared::Lua::LuaScript::loadCode(std::string, std::string)':
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:488: undefined reference to `luaL_loadbufferx'
/home/noq/.tmp/megaglest/source/shared_lib/sources/lua/lua_script.cpp:501: undefined reference to `lua_pcallk'
collect2: error: ld returned 1 exit status
make[2]: *** [../mk/linux/megaglest] Error 1
make[1]: *** [source/glest_game/CMakeFiles/megaglest.dir/all] Error 2
make: *** [all] Error 2

What am i missing?

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
Re: Build error: lua problems on linux
« Reply #1 on: 31 January 2013, 15:14:00 »
You did not post the full output of cmake. If you have both lua's installed its possible that cmake is using one of the versions but the code is not knowing which one and thus the special macro's for that version are not triggered.

set LUA_INCLUDE_DIR AND LUA_LIBRARIES to the lua 5.1 paths when running cmake.

NoQ

  • Guest
Re: Build error: lua problems on linux
« Reply #2 on: 31 January 2013, 18:22:24 »
Well, i just removed lua-5.2.1 (was only pulled by e17, which i'm not using ...), and it compiled. Thanks!
Anyway, i obtained a full log of a broken build, if it's still of any interest: http://pastebin.com/ZvHnZDua


 

anything