Forum > macOS / Mac OS X

Compiling an application using Lua

(1/4) > >>

cybermonkey342:
Hello,

I am stuck now. I can compile my program on Windows and Linux but not on MacOS X. It uses the units lua,lualib and lauxlib. I installed Lua from the source and it seems to work (at last the interactive mode works).
This is what I retrieve:

--- Code: ---Undefined symbols:
  "_lua_isstring", referenced from: _LUA_LUA_ISSTRING$POINTER$LONGINT$$LONGBOOL in lua.o
  "_luaL_loadstring", referenced from: _LAUXLIB_LUAL_LOADSTRING$POINTER$PCHAR$$LONGINT in lauxlib.o
  "_lua_createtable", referenced from: _LUA_LUA_CREATETABLE$POINTER$LONGINT$LONGINT in lua.o
  "_luaL_checktype", referenced from: _LAUXLIB_LUAL_CHECKTYPE$POINTER$LONGINT$LONGINT in lauxlib.o
  "_lua_pushvalue", referenced from: _LUA_LUA_PUSHVALUE$POINTER$LONGINT in lua.o
  "_lua_tothread", referenced from: _LUA_LUA_TOTHREAD$POINTER$LONGINT$$POINTER in lua.o
  "_lua_setupvalue", referenced from: _LUA_LUA_SETUPVALUE$POINTER$LONGINT$LONGINT$$PCHAR in lua.o
  "_luaopen_table", referenced from: _LUALIB_LUAOPEN_TABLE$POINTER$$LONGBOOL in lualib.o
  "_lua_getmetatable", referenced from: _LUA_LUA_GETMETATABLE$POINTER$LONGINT$$LONGINT in lua.o
  "_lua_rawget", referenced from: _LUA_LUA_RAWGET$POINTER$LONGINT in lua.o
  "_lua_rawset", referenced from: _LUA_LUA_RAWSET$POINTER$LONGINT in lua.o
  "_lua_remove", referenced from: _LUA_LUA_REMOVE$POINTER$LONGINT in lua.o
  "_lua_resume", referenced from: _LUA_LUA_RESUME$POINTER$LONGINT$$LONGINT in lua.o
  "_lua_pushnumber", referenced from: _LUA_LUA_PUSHNUMBER$POINTER$DOUBLE in lua.o
  "_lua_getfield", referenced from: _LUA_LUA_GETFIELD$POINTER$LONGINT$PCHAR in lua.o
  "_luaL_buffinit", referenced from: _LAUXLIB_LUAL_BUFFINIT$POINTER$PLUAL_BUFFER in lauxlib.o
  "_lua_isuserdata", referenced from: _LUA_LUA_ISUSERDATA$POINTER$LONGINT$$LONGBOOL in lua.o
  "_lua_setallocf", referenced from: _LUA_LUA_SETALLOCF$POINTER$LUA_ALLOC$POINTER in lua.o
  "_luaL_pushresult", referenced from: _LAUXLIB_LUAL_PUSHRESULT$PLUAL_BUFFER in lauxlib.o
  "_lua_settop", referenced from: _LUA_LUA_SETTOP$POINTER$LONGINT in lua.o
  "_lua_lessthan", referenced from: _LUA_LUA_LESSTHAN$POINTER$LONGINT$LONGINT$$LONGBOOL in lua.o
  "_lua_getlocal", referenced from: _LUA_LUA_GETLOCAL$POINTER$PLUA_DEBUG$LONGINT$$PCHAR in lua.o
  "_luaL_checkudata", referenced from: _LAUXLIB_LUAL_CHECKUDATA$POINTER$LONGINT$PCHAR$$POINTER in lauxlib.o
  "_luaL_checkstack", referenced from: _LAUXLIB_LUAL_CHECKSTACK$POINTER$LONGINT$PCHAR in lauxlib.o
  "_lua_checkstack", referenced from: _LUA_LUA_CHECKSTACK$POINTER$LONGINT$$LONGBOOL in lua.o
  "_lua_gettable", referenced from: _LUA_LUA_GETTABLE$POINTER$LONGINT in lua.o
  "_lua_getstack", referenced from: _LUA_LUA_GETSTACK$POINTER$LONGINT$PLUA_DEBUG$$LONGINT in lua.o
  "_lua_status", referenced from: _LUA_LUA_STATUS$POINTER$$LONGINT in lua.o
  "_lua_pushthread", referenced from: _LUA_LUA_PUSHTHREAD$POINTER in lua.o
  "_luaL_findtable", referenced from: _LAUXLIB_LUAL_FINDTABLE$POINTER$LONGINT$PCHAR$LONGINT$$PCHAR in lauxlib.o
  "_lua_pushvfstring", referenced from: _LUA_LUA_PUSHVFSTRING$POINTER$PCHAR$POINTER$$PCHAR in lua.o
  "_lua_iscfunction", referenced from: _LUA_LUA_ISCFUNCTION$POINTER$LONGINT$$LONGBOOL in lua.o
  "_lua_pushlstring", referenced from: _LUA_LUA_PUSHLSTRING$POINTER$PCHAR$LONGWORD in lua.o
  "_lua_pushstring", referenced from: _LUA_LUA_PUSHSTRING$POINTER$PCHAR in lua.o
  "_luaL_optinteger", referenced from: _LAUXLIB_LUAL_OPTINTEGER$POINTER$LONGINT$LONGINT$$LONGINT in lauxlib.o
  "_luaL_addstring", referenced from: _LAUXLIB_LUAL_ADDSTRING$PLUAL_BUFFER$PCHAR in lauxlib.o
  "_lua_atpanic", referenced from: _LUA_LUA_ATPANIC$POINTER$LUA_CFUNCTION$$LUA_CFUNCTION in lua.o
  "_lua_pushfstring", referenced from: _LUA_LUA_PUSHFSTRING$POINTER$PCHAR$$PCHAR in lua.o
  "_lua_rawequal", referenced from: _LUA_LUA_RAWEQUAL$POINTER$LONGINT$LONGINT$$LONGBOOL in lua.o
  "_lua_newthread", referenced from: _LUA_LUA_NEWTHREAD$POINTER$$POINTER in lua.o
  "_luaL_register", referenced from: _LAUXLIB_LUAL_REGISTER$POINTER$PCHAR$PLUAL_REG in lauxlib.o
  "_luaL_typerror", referenced from: _LAUXLIB_LUAL_TYPERROR$POINTER$LONGINT$PCHAR$$LONGINT in lauxlib.o
  "_lua_tocfunction", referenced from: _LUA_LUA_TOCFUNCTION$POINTER$LONGINT$$LUA_CFUNCTION in lua.o
  "_lua_pushcclosure", referenced from: _LUA_LUA_PUSHCCLOSURE$POINTER$LUA_CFUNCTION$LONGINT in lua.o
  "_lua_tolstring", referenced from: _LUA_LUA_TOLSTRING$POINTER$LONGINT$PSIZE_T$$PCHAR in lua.o
  "_lua_gc", referenced from: _LUA_LUA_GC$POINTER$LONGINT$LONGINT$$LONGINT in lua.o
  "_lua_pushlightuserdata", referenced from: _LUA_LUA_PUSHLIGHTUSERDATA$POINTER$POINTER in lua.o
  "_luaL_addlstring", referenced from: _LAUXLIB_LUAL_ADDLSTRING$PLUAL_BUFFER$PCHAR$LONGWORD in lauxlib.o
  "_lua_getallocf", referenced from: _LUA_LUA_GETALLOCF$POINTER$PPOINTER$$LUA_ALLOC in lua.o
  "_lua_rawgeti", referenced from: _LUA_LUA_RAWGETI$POINTER$LONGINT$LONGINT in lua.o
  "_luaL_loadbuffer", referenced from: _LAUXLIB_LUAL_LOADBUFFER$POINTER$PCHAR$LONGWORD$PCHAR$$LONGINT in lauxlib.o
  "_lua_rawseti", referenced from: _LUA_LUA_RAWSETI$POINTER$LONGINT$LONGINT in lua.o
  "_luaL_error", referenced from: _LAUXLIB_LUAL_ERROR$POINTER$PCHAR$array_of_const$$LONGINT in lauxlib.o
  "_lua_typename", referenced from: _LUA_LUA_TYPENAME$POINTER$LONGINT$$PCHAR in lua.o
  "_lua_pushboolean", referenced from: _LUA_LUA_PUSHBOOLEAN$POINTER$LONGBOOL in lua.o
  "_lua_close", referenced from: _LUA_LUA_CLOSE$POINTER in lua.o
  "_lua_replace", referenced from: _LUA_LUA_REPLACE$POINTER$LONGINT in lua.o
  "_luaopen_string", referenced from: _LUALIB_LUAOPEN_STRING$POINTER$$LONGBOOL in lualib.o
  "_lua_equal", referenced from: _LUA_LUA_EQUAL$POINTER$LONGINT$LONGINT$$LONGBOOL in lua.o
  "_lua_error", referenced from: _LUA_LUA_ERROR$POINTER$$LONGINT in lua.o
  "_luaL_ref", referenced from: _LAUXLIB_LUAL_REF$POINTER$LONGINT$$LONGINT in lauxlib.o
  "_luaopen_io", referenced from: _LUALIB_LUAOPEN_IO$POINTER$$LONGBOOL in lualib.o
  "_luaopen_package", referenced from: _LUALIB_LUAOPEN_PACKAGE$POINTER$$LONGBOOL in lualib.o
  "_luaL_unref", referenced from: _LAUXLIB_LUAL_UNREF$POINTER$LONGINT$LONGINT in lauxlib.o
  "_luaL_where", referenced from: _LAUXLIB_LUAL_WHERE$POINTER$LONGINT in lauxlib.o
  "_luaopen_base", referenced from: _LUALIB_LUAOPEN_BASE$POINTER$$LONGBOOL in lualib.o
  "_lua_pcall", referenced from: _LUA_LUA_PCALL$POINTER$LONGINT$LONGINT$LONGINT$$LONGINT in lua.o
  "_luaopen_math", referenced from: _LUALIB_LUAOPEN_MATH$POINTER$$LONGBOOL in lualib.o
  "_lua_gethookcount", referenced from: _LUA_LUA_GETHOOKCOUNT$POINTER$$LONGINT in lua.o
  "_lua_pushinteger", referenced from: _LUA_LUA_PUSHINTEGER$POINTER$LONGINT in lua.o
  "_lua_newuserdata", referenced from: _LUA_LUA_NEWUSERDATA$POINTER$LONGWORD$$POINTER in lua.o
  "_luaL_checklstring", referenced from: _LAUXLIB_LUAL_CHECKLSTRING$POINTER$LONGINT$PSIZE_T$$PCHAR in lauxlib.o
  "_lua_setfield", referenced from: _LUA_LUA_SETFIELD$POINTER$LONGINT$PCHAR in lua.o
  "_luaL_addvalue", referenced from: _LAUXLIB_LUAL_ADDVALUE$PLUAL_BUFFER in lauxlib.o
  "_lua_toboolean", referenced from: _LUA_LUA_TOBOOLEAN$POINTER$LONGINT$$LONGBOOL in lua.o
  "_lua_yield", referenced from: _LUA_LUA_YIELD$POINTER$LONGINT$$LONGINT in lua.o
  "_lua_xmove", referenced from: _LUA_LUA_XMOVE$POINTER$POINTER$LONGINT in lua.o
  "_lua_getupvalue", referenced from: _LUA_LUA_GETUPVALUE$POINTER$LONGINT$LONGINT$$PCHAR in lua.o
  "_luaL_openlibs", referenced from: _LUALIB_LUAL_OPENLIBS$POINTER in lualib.o
  "_lua_cpcall", referenced from: _LUA_LUA_CPCALL$POINTER$LUA_CFUNCTION$POINTER$$LONGINT in lua.o
  "_lua_concat", referenced from: _LUA_LUA_CONCAT$POINTER$LONGINT in lua.o
  "_lua_setlocal", referenced from: _LUA_LUA_SETLOCAL$POINTER$PLUA_DEBUG$LONGINT$$PCHAR in lua.o
  "_lua_call", referenced from: _LUA_LUA_CALL$POINTER$LONGINT$LONGINT in lua.o
  "_lua_dump", referenced from: _LUA_LUA_DUMP$POINTER$LUA_WRITER$POINTER$$LONGINT in lua.o
  "_lua_load", referenced from: _LUA_LUA_LOAD$POINTER$LUA_READER$POINTER$PCHAR$$LONGINT in lua.o
  "_lua_next", referenced from: _LUA_LUA_NEXT$POINTER$LONGINT$$LONGINT in lua.o
  "_lua_setfenv", referenced from: _LUA_LUA_SETFENV$POINTER$LONGINT$$LONGINT in lua.o
  "_lua_gethookmask", referenced from: _LUA_LUA_GETHOOKMASK$POINTER$$LONGINT in lua.o
  "_lua_type", referenced from: _LUA_LUA_TYPE$POINTER$LONGINT$$LONGINT in lua.o
  "_lua_settable", referenced from: _LUA_LUA_SETTABLE$POINTER$LONGINT in lua.o
  "_lua_sethook", referenced from: _LUA_LUA_SETHOOK$POINTER$LUA_HOOK$LONGINT$LONGINT$$LONGINT in lua.o
  "_luaL_openlib", referenced from: _LAUXLIB_LUAL_OPENLIB$POINTER$PCHAR$PLUAL_REG$LONGINT in lauxlib.o
  "_luaL_newstate", referenced from: _LAUXLIB_LUAL_NEWSTATE$$POINTER in lauxlib.o
  "_luaL_getmetafield", referenced from: _LAUXLIB_LUAL_GETMETAFIELD$POINTER$LONGINT$PCHAR$$LONGINT in lauxlib.o
  "_lua_pushnil", referenced from: _LUA_LUA_PUSHNIL$POINTER in lua.o
  "_lua_touserdata", referenced from: _LUA_LUA_TOUSERDATA$POINTER$LONGINT$$POINTER in lua.o
  "_lua_tointeger", referenced from: _LUA_LUA_TOINTEGER$POINTER$LONGINT$$LONGINT in lua.o
  "_lua_setmetatable", referenced from: _LUA_LUA_SETMETATABLE$POINTER$LONGINT$$LONGINT in lua.o
  "_lua_gettop", referenced from: _LUA_LUA_GETTOP$POINTER$$LONGINT in lua.o
  "_luaL_checknumber", referenced from: _LAUXLIB_LUAL_CHECKNUMBER$POINTER$LONGINT$$DOUBLE in lauxlib.o
  "_luaL_checkoption", referenced from: _LAUXLIB_LUAL_CHECKOPTION$POINTER$LONGINT$PCHAR$PPCHAR$$LONGINT in lauxlib.o
  "_luaL_checkany", referenced from: _LAUXLIB_LUAL_CHECKANY$POINTER$LONGINT in lauxlib.o
  "_lua_getfenv", referenced from: _LUA_LUA_GETFENV$POINTER$LONGINT in lua.o
  "_lua_getinfo", referenced from: _LUA_LUA_GETINFO$POINTER$PCHAR$PLUA_DEBUG$$LONGINT in lua.o
  "_lua_isnumber", referenced from: _LUA_LUA_ISNUMBER$POINTER$LONGINT$$LONGBOOL in lua.o
  "_lua_topointer", referenced from: _LUA_LUA_TOPOINTER$POINTER$LONGINT$$POINTER in lua.o
  "_luaL_optnumber", referenced from: _LAUXLIB_LUAL_OPTNUMBER$POINTER$LONGINT$DOUBLE$$DOUBLE in lauxlib.o
  "_lua_newstate", referenced from: _LUA_LUA_NEWSTATE$LUA_ALLOC$POINTER$$POINTER in lua.o
  "_lua_insert", referenced from: _LUA_LUA_INSERT$POINTER$LONGINT in lua.o
  "_luaL_argerror", referenced from: _LAUXLIB_LUAL_ARGERROR$POINTER$LONGINT$PCHAR$$LONGINT in lauxlib.o
  "_luaL_gsub", referenced from: _LAUXLIB_LUAL_GSUB$POINTER$PCHAR$PCHAR$PCHAR$$PCHAR in lauxlib.o
  "_luaL_newmetatable", referenced from: _LAUXLIB_LUAL_NEWMETATABLE$POINTER$PCHAR$$LONGINT in lauxlib.o
  "_luaL_loadfile", referenced from: _LAUXLIB_LUAL_LOADFILE$POINTER$PCHAR$$LONGINT in lauxlib.o
  "_luaL_prepbuffer", referenced from: _LAUXLIB_LUAL_PREPBUFFER$PLUAL_BUFFER$$PCHAR in lauxlib.o
  "_lua_tonumber", referenced from: _LUA_LUA_TONUMBER$POINTER$LONGINT$$DOUBLE in lua.o
  "_luaL_optlstring", referenced from: _LAUXLIB_LUAL_OPTLSTRING$POINTER$LONGINT$PCHAR$PSIZE_T$$PCHAR in lauxlib.o
  "_luaL_callmeta", referenced from: _LAUXLIB_LUAL_CALLMETA$POINTER$LONGINT$PCHAR$$LONGINT in lauxlib.o
  "_luaL_checkinteger", referenced from: _LAUXLIB_LUAL_CHECKINTEGER$POINTER$LONGINT$$LONGINT in lauxlib.o
  "_lua_objlen", referenced from: _LUA_LUA_OBJLEN$POINTER$LONGINT$$LONGWORD in lua.o
  "_luaopen_debug", referenced from: _LUALIB_LUAOPEN_DEBUG$POINTER$$LONGBOOL in lualib.o
ld: symbol(s) not found
Error: Error while linking

--- End code ---
Any help is appreciated ...

skalogryz:

--- Quote from: cybermonkey342 on August 01, 2010, 10:07:27 pm ---I am stuck now. I can compile my program on Windows and Linux but not on MacOS X. It uses the units lua,lualib and lauxlib. I installed Lua from the source and it seems to work (at last the interactive mode works).

--- End quote ---
where to find lua* files?

felipemdc:
Which bindings to lua do you use?

cybermonkey342:

--- Quote from: skalogryz on August 04, 2010, 09:16:41 pm ---
--- Quote from: cybermonkey342 on August 01, 2010, 10:07:27 pm ---I am stuck now. I can compile my program on Windows and Linux but not on MacOS X. It uses the units lua,lualib and lauxlib. I installed Lua from the source and it seems to work (at last the interactive mode works).

--- End quote ---
where to find lua* files?

--- End quote ---
If you mean the libs, they are located in "usr/local/lib"

cybermonkey342:

--- Quote from: felipemdc on August 04, 2010, 09:25:16 pm ---Which bindings to lua do you use?

--- End quote ---
The units shipped with Freepascal.

Navigation

[0] Message Index

[#] Next page

Go to full version