Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed linking wx.dylib with lua library (when building on macOS with … #45

Closed
wants to merge 1 commit into from

Conversation

valid-ptr
Copy link
Contributor

…external lua library)

@sonoro1234
Copy link
Contributor

Did it work without the fix?

@pkulchenko
Copy link
Owner

@valid-ptr, I'm not sure why this is needed. I'm building on macOS with an external library and don't see any issues. Here is the cmake command: https://github.com/pkulchenko/ZeroBraneStudio/blob/master/build/build-macosx.sh#L304

@pkulchenko pkulchenko self-assigned this Oct 1, 2019
@sonoro1234
Copy link
Contributor

sonoro1234 commented Oct 1, 2019

I was asking if it worked without the fix because: According to http://lua-users.org/wiki/BuildingModules modules should not link against lualib except for windows.
I could check this is true on linux.

@pkulchenko
Copy link
Owner

It does work for me on both macOS and linux with the current configuration (without the fix).

@valid-ptr
Copy link
Contributor Author

valid-ptr commented Oct 1, 2019

This is my configuration (perl):

	my $components="gl;xrc;xml;net;propgrid;richtext;aui;stc;html;adv;core;base";

	system(" cmake".
		   " -DCMAKE_INSTALL_PREFIX=$install_dir".
		   " -DCMAKE_BUILD_TYPE=Release".
		   " -DCMAKE_OSX_DEPLOYMENT_TARGET=$ENV{\"EVI_OSX_SDK_VERSION_MIN\"}".
		   " -DCMAKE_OSX_ARCHITECTURES=\"$ENV{EVI_CMAKE_OSX_ARHCS}\"".
		   " -DwxWidgets_CONFIG_EXECUTABLE=$install_dir/bin/wx-config".
		   " -DwxWidgets_COMPONENTS=\"$components\"".
		   " -DBUILD_VERBOSELY=ON".
		   " -DBUILD_SHARED_LIBS=OFF".
		   " -DwxLua_LUA_LIBRARY_USE_BUILTIN=OFF".
		   " -DwxLua_LUA_LIBRARY_VERSION=5.1".
		   " -DwxLua_LUA_INCLUDE_DIR=$install_dir/include/lua5.1/".
		   " -DwxLua_LUA_LIBRARY=$install_dir/lib/liblua5.1.a".
		   "  $src_dir"
		   ) and die "Can't configure '$libname'";

I think, the reason of linking error is, that static (archive) liblua5.1.a used in my configuration instead of liblua.dylib in your configuration.

ERROR OUTPUT IN CONSOLE:

Undefined symbols for architecture x86_64:
  "_luaL_argerror", referenced from:
      _b_extract in lbitlib.c.o
      _b_replace in lbitlib.c.o
      wxLuaState::luaL_ArgError(int, char const*) in wxlstate.cpp.o
      wxLuaState::luaL_ArgCheck(bool, int, char const*) in wxlstate.cpp.o
  "_luaL_callmeta", referenced from:
      wxLuaState::luaL_CallMeta(int, char const*) in wxlstate.cpp.o
  "_luaL_checkany", referenced from:
      wxLuaState::luaL_CheckAny(int) in wxlstate.cpp.o
  "_luaL_checkinteger", referenced from:
      _b_arshift in lbitlib.c.o
      _b_extract in lbitlib.c.o
      _b_lrot in lbitlib.c.o
      _b_lshift in lbitlib.c.o
      _b_replace in lbitlib.c.o
      _b_rrot in lbitlib.c.o
      _b_rshift in lbitlib.c.o
      ...
  "_luaL_checklstring", referenced from:
      wxLuaState::luaL_CheckLString(int, unsigned long*) in wxlstate.cpp.o
      wxLuaState::luaL_CheckString(int) in wxlstate.cpp.o
  "_luaL_checknumber", referenced from:
      wxLuaState::luaL_CheckNumber(int) in wxlstate.cpp.o
  "_luaL_checkoption", referenced from:
      wxLuaState::luaL_CheckOption(int, char const*, char const* const*) in wxlstate.cpp.o
  "_luaL_checkstack", referenced from:
      wxlua_pushargs(lua_State*, wchar_t**, int, int) in wxllua.cpp.o
      wxLuaState::luaL_CheckStack(int, char const*) in wxlstate.cpp.o
  "_luaL_checktype", referenced from:
      _b_arshift in lbitlib.c.o
      _b_and in lbitlib.c.o
      _b_not in lbitlib.c.o
      _b_or in lbitlib.c.o
      _b_xor in lbitlib.c.o
      _b_test in lbitlib.c.o
      _b_extract in lbitlib.c.o
      ...
  "_luaL_checkudata", referenced from:
      wxLuaState::luaL_CheckUdata(int, char const*) in wxlstate.cpp.o
  "_luaL_error", referenced from:
      wxLuaDebugTarget::LuaPrint(lua_State*) in wxldtarg.cpp.o
      _luaopen_bit in bit.c.o
      _b_extract in lbitlib.c.o
      _b_replace in lbitlib.c.o
      wxlua_error(lua_State*, char const*) in wxllua.cpp.o
      wxlua_argerrormsg(lua_State*, wxString const&) in wxllua.cpp.o
      wxluaT_setmetatable(lua_State*, int) in wxllua.cpp.o
      ...
  "_luaL_getmetafield", referenced from:
      wxLuaState::luaL_GetMetafield(int, char const*) in wxlstate.cpp.o
  "_luaL_loadbuffer", referenced from:
      wxLuaDebugTarget::EvaluateExpr(int, wxString const&) in wxldtarg.cpp.o
      wxLuaState::RunBuffer(char const*, unsigned long, wxString const&, int) in wxlstate.cpp.o
      wxLuaState::luaL_LoadBuffer(char const*, unsigned long, char const*) in wxlstate.cpp.o
      wxLuaState::CompileBuffer(char const*, unsigned long, wxString const&, wxString*, int*) in wxlstate.cpp.o
  "_luaL_loadfile", referenced from:
      wxLuaState::RunFile(wxString const&, int) in wxlstate.cpp.o
      wxLuaState::luaL_LoadFile(char const*) in wxlstate.cpp.o
  "_luaL_loadstring", referenced from:
      wxLuaState::luaL_LoadString(char const*) in wxlstate.cpp.o
  "_luaL_newmetatable", referenced from:
      wxLuaState::luaL_NewMetatable(char const*) in wxlstate.cpp.o
  "_luaL_newstate", referenced from:
      wxLuaState::Create(wxEvtHandler*, int) in wxlstate.cpp.o
      wxLuaState::CompileBuffer(char const*, unsigned long, wxString const&, wxString*, int*) in wxlstate.cpp.o
  "_luaL_openlibs", referenced from:
      wxLuaState::Create(wxEvtHandler*, int) in wxlstate.cpp.o
      wxLuaState::CompileBuffer(char const*, unsigned long, wxString const&, wxString*, int*) in wxlstate.cpp.o
  "_luaL_optinteger", referenced from:
      _b_extract in lbitlib.c.o
      _b_replace in lbitlib.c.o
      wxLuaState::luaL_OptInteger(int, long) in wxlstate.cpp.o
      wxLuaState::luaL_OptInt(int, int) in wxlstate.cpp.o
      wxLuaState::luaL_OptLong(int, int) in wxlstate.cpp.o
  "_luaL_optlstring", referenced from:
      wxLuaState::luaL_OptLString(int, char const*, unsigned long*) in wxlstate.cpp.o
      wxLuaState::luaL_OptString(int, char const*) in wxlstate.cpp.o
  "_luaL_optnumber", referenced from:
      wxLuaState::luaL_OptNumber(int, double) in wxlstate.cpp.o
  "_luaL_ref", referenced from:
      wxLua_wxListCtrl_SortItems(lua_State*) in wxcore_controls.cpp.o
      wxluaR_ref(lua_State*, int, void*) in wxllua.cpp.o
      wxLuaState::luaL_Ref(int) in wxlstate.cpp.o
  "_luaL_register", referenced from:
      _luaopen_bit in bit.c.o
      _luaopen_bit32 in lbitlib.c.o
      wxLuaState::luaL_Register(lua_State*, char const*, luaL_Reg const*) in wxlstate.cpp.o
      wxLuaState::luaL_Register(char const*, luaL_Reg const*) in wxlstate.cpp.o
  "_luaL_typerror", referenced from:
      _luaopen_bit in bit.c.o
      _bit_tobit in bit.c.o
      _bit_bnot in bit.c.o
      _bit_band in bit.c.o
      _bit_bor in bit.c.o
      _bit_bxor in bit.c.o
      _bit_lshift in bit.c.o
      ...
  "_luaL_unref", referenced from:
      wxLua_wxListCtrl_SortItems(lua_State*) in wxcore_controls.cpp.o
      wxluaR_unref(lua_State*, int, void*) in wxllua.cpp.o
      wxLuaState::luaL_Unref(int, int) in wxlstate.cpp.o
  "_luaL_where", referenced from:
      wxLuaState::luaL_Where(int) in wxlstate.cpp.o
  "_lua_call", referenced from:
      wxLuaDebugTarget::LuaPrint(lua_State*) in wxldtarg.cpp.o
      wxlua_printFunction(lua_State*) in wxlstate.cpp.o
      wxLuaState::Create(lua_State*, int) in wxlstate.cpp.o
      wxlua_traceback(lua_State*) in wxlstate.cpp.o
      wxLuaState::lua_Call(int, int) in wxlstate.cpp.o
  "_lua_checkstack", referenced from:
      wxLuaState::lua_CheckStack(int) in wxlstate.cpp.o
  "_lua_close", referenced from:
      wxLuaStateRefData::CloseLuaState(bool) in wxlstate.cpp.o
      wxLuaState::CompileBuffer(char const*, unsigned long, wxString const&, wxString*, int*) in wxlstate.cpp.o
  "_lua_concat", referenced from:
      wxLuaState::lua_Concat(int) in wxlstate.cpp.o
  "_lua_cpcall", referenced from:
      wxLuaState::lua_CPCall(int (*)(lua_State*), void*) in wxlstate.cpp.o
  "_lua_createtable", referenced from:
      wxLua_wxDataObject_GetAllFormats(lua_State*) in wxcore_clipdrag.cpp.o
      wxLua_wxDropFilesEvent_GetFiles(lua_State*) in wxcore_clipdrag.cpp.o
      wxLua_wxTreeCtrl_GetSelections(lua_State*) in wxcore_controls.cpp.o
      wxLua_wxTreeListCtrl_GetSelections(lua_State*) in wxcore_controls.cpp.o
      wxLuaBinding::InstallClass(lua_State*, wxLuaBindClass const*) in wxlbind.cpp.o
      wxlua_lreg_createtable(lua_State*, void*, int, int) in wxllua.cpp.o
      wxluaO_trackweakobject(lua_State*, int, void*, int) in wxllua.cpp.o
      ...
  "_lua_dump", referenced from:
      wxLuaState::lua_Dump(int (*)(lua_State*, void const*, unsigned long, void*), void*) in wxlstate.cpp.o
  "_lua_equal", referenced from:
      wxluaR_isrefed(lua_State*, int, void*) in wxllua.cpp.o
      wxLuaState::lua_Equal(int, int) const in wxlstate.cpp.o
  "_lua_error", referenced from:
      wxLuaState::lua_Error() in wxlstate.cpp.o
  "_lua_gc", referenced from:
      wxLuaStackDialog::RemoveAllLuaReferences() in wxlstack.cpp.o
      wxLuaStateRefData::CloseLuaState(bool) in wxlstate.cpp.o
      wxLuaState::Create(lua_State*, int) in wxlstate.cpp.o
      wxLuaState::lua_GC(int, int) in wxlstate.cpp.o
  "_lua_getfenv", referenced from:
      wxLuaState::lua_GetFenv(int) in wxlstate.cpp.o
  "_lua_getfield", referenced from:
      _luaopen_wx in luamodule.cpp.o
      wxLuaDebugTarget::LuaPrint(lua_State*) in wxldtarg.cpp.o
      wxLuaBinding::InstallClass(lua_State*, wxLuaBindClass const*) in wxlbind.cpp.o
      wxlua_printFunction(lua_State*) in wxlstate.cpp.o
      wxLuaState::Create(lua_State*, int) in wxlstate.cpp.o
      wxlua_traceback(lua_State*) in wxlstate.cpp.o
      wxLuaState::lua_GetField(int, char const*) in wxlstate.cpp.o
      ...
  "_lua_gethook", referenced from:
      wxLuaState::lua_GetHook() in wxlstate.cpp.o
  "_lua_gethookcount", referenced from:
      wxLuaState::lua_GetHookCount() in wxlstate.cpp.o
  "_lua_gethookmask", referenced from:
      wxLuaState::lua_GetHookMask() in wxlstate.cpp.o
  "_lua_getinfo", referenced from:
      wxLuaDebugTarget::DebugHook(int) in wxldtarg.cpp.o
      wxLuaDebugData::EnumerateStack(lua_State*) in wxldebug.cpp.o
      wxlua_getLuaArgsMsg(lua_State*, int, int) in wxlbind.cpp.o
      wxLuaConsole::DisplayStack(wxLuaState const&) in wxlconsole.cpp.o
      wxlua_debugHookFunction(lua_State*, lua_Debug*) in wxlstate.cpp.o
      wxLuaState::lua_GetInfo(char const*, lua_Debug*) in wxlstate.cpp.o
  "_lua_getlocal", referenced from:
      wxLuaDebugTarget::EvaluateExpr(int, wxString const&) in wxldtarg.cpp.o
      wxLuaDebugData::EnumerateStackEntry(lua_State*, int, wxArrayInt&) in wxldebug.cpp.o
      wxLuaState::lua_GetLocal(lua_Debug const*, int) in wxlstate.cpp.o
  "_lua_getmetatable", referenced from:
      wxLuaDebugData::EnumerateStackEntry(lua_State*, int, wxArrayInt&) in wxldebug.cpp.o
      wxLuaDebugData::EnumerateTable(lua_State*, int, int, wxArrayInt&) in wxldebug.cpp.o
      wxLuaBinding::InstallClass(lua_State*, wxLuaBindClass const*) in wxlbind.cpp.o
      wxluaO_deletegcobject(lua_State*, int, int) in wxllua.cpp.o
      wxluaT_type(lua_State*, int) in wxllua.cpp.o
      wxLuaState::lua_GetMetatable(int) in wxlstate.cpp.o
  "_lua_getstack", referenced from:
      wxLuaDebugTarget::EvaluateExpr(int, wxString const&) in wxldtarg.cpp.o
      wxLuaDebugTarget::DebugHook(int) in wxldtarg.cpp.o
      wxLuaDebugData::EnumerateStack(lua_State*) in wxldebug.cpp.o
      wxLuaDebugData::EnumerateStackEntry(lua_State*, int, wxArrayInt&) in wxldebug.cpp.o
      wxlua_getLuaArgsMsg(lua_State*, int, int) in wxlbind.cpp.o
      wxLuaConsole::DisplayStack(wxLuaState const&) in wxlconsole.cpp.o
      wxLuaState::lua_GetStack(int, lua_Debug*) in wxlstate.cpp.o
      ...
  "_lua_gettable", referenced from:
      wxLua_wxCreateMenu_constructor(lua_State*) in wxcore_menutool.cpp.o
      wxLua_wxAcceleratorTable_constructor(lua_State*) in wxcore_menutool.cpp.o
      wxLuaState::lua_GetTable(int) in wxlstate.cpp.o
  "_lua_gettop", referenced from:
      wxLua_wxGLAttribsBase_SetNeedsARB(lua_State*) in wxgl_bind.cpp.o
      wxLua_wxGLContextAttrs_ReleaseFlush(lua_State*) in wxgl_bind.cpp.o
      wxLua_wxStyledTextCtrl_AddTextRaw(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_AppendTextRaw(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_BraceMatch(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_FindText(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_GetPropertyInt(lua_State*) in wxstc_bind.cpp.o
      ...
  "_lua_getupvalue", referenced from:
      wxLuaState::lua_GetUpvalue(int, int) in wxlstate.cpp.o
  "_lua_insert", referenced from:
      wxlua_printFunction(lua_State*) in wxlstate.cpp.o
      wxLuaState::LuaPCall(int, int) in wxlstate.cpp.o
      wxLuaState::lua_Insert(int) in wxlstate.cpp.o
  "_lua_iscfunction", referenced from:
      wxLuaDebugData::GetTypeValue(lua_State*, int, int*, wxString&) in wxldebug.cpp.o
      wxLuaState::lua_IsCFunction(int) const in wxlstate.cpp.o
  "_lua_isnumber", referenced from:
      wxLua_wxCreateMenu_constructor(lua_State*) in wxcore_menutool.cpp.o
      wxLuaStackDialog::RemoveAllLuaReferences() in wxlstack.cpp.o
      _luaopen_bit in bit.c.o
      _bit_tobit in bit.c.o
      _bit_bnot in bit.c.o
      _bit_band in bit.c.o
      _bit_bor in bit.c.o
      ...
  "_lua_isstring", referenced from:
      wxLua_wxCreateMenu_constructor(lua_State*) in wxcore_menutool.cpp.o
      wxlua_traceback(lua_State*) in wxlstate.cpp.o
      wxLuaState::lua_IsString(int) const in wxlstate.cpp.o
  "_lua_isuserdata", referenced from:
      wxLua_wxAcceleratorTable_constructor(lua_State*) in wxcore_menutool.cpp.o
      wxLuaState::lua_IsUserdata(int) const in wxlstate.cpp.o
  "_lua_lessthan", referenced from:
      wxLuaState::lua_LessThan(int, int) const in wxlstate.cpp.o
  "_lua_load", referenced from:
      wxLuaState::lua_Load(char const* (*)(lua_State*, void*, unsigned long*), void*, char const*) in wxlstate.cpp.o
  "_lua_newuserdata", referenced from:
      wxluaT_pushuserdatatype(lua_State*, void const*, int, bool, bool) in wxllua.cpp.o
      wxLuaState::lua_NewUserdata(unsigned long) in wxlstate.cpp.o
      wxluabind_wxLuaBindCFunc__index(lua_State*) in wxlua_bind.cpp.o
      wxluabind_wxLuaBindClass__index(lua_State*) in wxlua_bind.cpp.o
      wxluabind_wxLuaBindMethod__index(lua_State*) in wxlua_bind.cpp.o
      wxluabind_wxLuaBinding__index(lua_State*) in wxlua_bind.cpp.o
      wxLua_function_GetBindings(lua_State*) in wxlua_bind.cpp.o
      ...
  "_lua_next", referenced from:
      wxLuaDebugTarget::EvaluateExpr(int, wxString const&) in wxldtarg.cpp.o
      wxLuaDebugData::EnumerateTable(lua_State*, int, int, wxArrayInt&) in wxldebug.cpp.o
      wxLuaCheckStack::DumpTable(int, wxString const&, wxString const&, wxSortedArrayString&, int) in wxldebug.cpp.o
      wxLuaStackDialog::RemoveAllLuaReferences() in wxlstack.cpp.o
      wxLuaBinding::RegisterBinding(wxLuaState const&) in wxlbind.cpp.o
      wxLuaWinDestroyCallback::OnDestroy(wxWindowDestroyEvent&) in wxlcallb.cpp.o
      wxluaR_isrefed(lua_State*, int, void*) in wxllua.cpp.o
      ...
  "_lua_objlen", referenced from:
      wxLua_wxDataObject_SetData(lua_State*) in wxcore_clipdrag.cpp.o
      wxLua_wxDataObjectSimple_SetData(lua_State*) in wxcore_clipdrag.cpp.o
      wxLua_wxCreateMenu_constructor(lua_State*) in wxcore_menutool.cpp.o
      wxLua_wxAcceleratorTable_constructor(lua_State*) in wxcore_menutool.cpp.o
      wxLua_wxSocketBase_Unread(lua_State*) in wxnet_bind.cpp.o
      wxLua_wxSocketBase_Write(lua_State*) in wxnet_bind.cpp.o
      wxLua_wxSocketBase_WriteMsg(lua_State*) in wxnet_bind.cpp.o
      ...
  "_lua_pcall", referenced from:
      wxLuaDebugTarget::EvaluateExpr(int, wxString const&) in wxldtarg.cpp.o
      wxLuaState::LuaPCall(int, int) in wxlstate.cpp.o
      wxLuaState::lua_PCall(int, int, int) in wxlstate.cpp.o
  "_lua_pushboolean", referenced from:
      wxLua_wxGLCanvas_IsDisplaySupported1(lua_State*) in wxgl_bind.cpp.o
      wxLua_wxGLCanvas_IsDisplaySupported(lua_State*) in wxgl_bind.cpp.o
      wxLua_wxGLCanvas_IsExtensionSupported(lua_State*) in wxgl_bind.cpp.o
      wxLua_wxGLCanvas_SetCurrent2(lua_State*) in wxgl_bind.cpp.o
      wxLua_wxGLAttribsBase_NeedsARB(lua_State*) in wxgl_bind.cpp.o
      wxLua_wxStyledTextCtrl_AutoCompActive(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_AutoCompGetAutoHide(lua_State*) in wxstc_bind.cpp.o
      ...
  "_lua_pushcclosure", referenced from:
      wxLuaDebugTarget::wxLuaDebugTarget(wxLuaState const&, wxString const&, int) in wxldtarg.cpp.o
      wxlua_wxLuaBindClass__index(lua_State*) in wxlbind.cpp.o
      wxLuaBinding::DoRegisterBinding(wxLuaState const&) const in wxlbind.cpp.o
      wxLuaBinding::InstallClassMetatable(lua_State*, wxLuaBindClass const*) in wxlbind.cpp.o
      wxLuaBinding::InstallClass(lua_State*, wxLuaBindClass const*) in wxlbind.cpp.o
      wxLuaState::Create(lua_State*, int) in wxlstate.cpp.o
      wxLuaState::RegisterFunction(int (*)(lua_State*), char const*) in wxlstate.cpp.o
      ...
  "_lua_pushinteger", referenced from:
      wxlua_traceback(lua_State*) in wxlstate.cpp.o
      wxLuaState::lua_PushInteger(long) in wxlstate.cpp.o
  "_lua_pushlightuserdata", referenced from:
      wxLua_wxGLAttribsBase_GetGLAttrs(lua_State*) in wxgl_bind.cpp.o
      wxLua_wxStyledTextCtrl_CreateDocument(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_GetDirectFunction(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_GetDirectPointer(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_GetDocPointer(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_PrivateLexerCall(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxTreeCtrl_GetFirstChild(lua_State*) in wxcore_controls.cpp.o
      ...
  "_lua_pushlstring", referenced from:
      wxLua_wxDataObject_GetDataHere(lua_State*) in wxcore_clipdrag.cpp.o
      wxLua_wxDataObjectSimple_GetDataHere(lua_State*) in wxcore_clipdrag.cpp.o
      wxLua_wxImage_GetAlphaData(lua_State*) in wxcore_image.cpp.o
      wxLua_wxImage_GetData(lua_State*) in wxcore_image.cpp.o
      wxLua_wxSocketBase_Peek(lua_State*) in wxnet_bind.cpp.o
      wxLua_wxSocketBase_Read(lua_State*) in wxnet_bind.cpp.o
      wxLua_wxSocketBase_ReadMsg(lua_State*) in wxnet_bind.cpp.o
      ...
  "_lua_pushnil", referenced from:
      wxLua_wxLuaTreeItemData_GetData(lua_State*) in wxcore_controls.cpp.o
      wxLua_wxImage_GetAlphaData(lua_State*) in wxcore_image.cpp.o
      wxLuaDebugTarget::EvaluateExpr(int, wxString const&) in wxldtarg.cpp.o
      wxLuaDebugData::EnumerateTable(lua_State*, int, int, wxArrayInt&) in wxldebug.cpp.o
      wxLuaCheckStack::DumpTable(int, wxString const&, wxString const&, wxSortedArrayString&, int) in wxldebug.cpp.o
      wxLuaStackDialog::RemoveAllLuaReferences() in wxlstack.cpp.o
      wxlua_userdata_delete(lua_State*) in wxlbind.cpp.o
      ...
  "_lua_pushnumber", referenced from:
      wxLua_wxGLAttribsBase_GetSize(lua_State*) in wxgl_bind.cpp.o
      wxLua_wxStyledTextCtrl_AddSelection(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_AllocateExtendedStyles(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_AllocateSubStyles(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_AnnotationGetLines(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_AnnotationGetStyle(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_AnnotationGetStyleOffset(lua_State*) in wxstc_bind.cpp.o
      ...
  "_lua_pushstring", referenced from:
      wxLua_wxStyledTextCtrl_GetCurLine(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_GetLineRaw(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_GetSelectedTextRaw(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_GetTargetTextRaw(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_GetTextRangeRaw(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_GetTextRaw(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxString_To8BitData(lua_State*) in wxbase_data.cpp.o
      ...
  "_lua_pushvalue", referenced from:
      wxLua_wxListCtrl_SortItems(lua_State*) in wxcore_controls.cpp.o
      wxLua_wxObject_DynamicCast(lua_State*) in wxbase_data.cpp.o
      wxLuaDebugTarget::LuaPrint(lua_State*) in wxldtarg.cpp.o
      wxLuaDebugTarget::EvaluateExpr(int, wxString const&) in wxldtarg.cpp.o
      wxLuaDebugData::EnumerateTable(lua_State*, int, int, wxArrayInt&) in wxldebug.cpp.o
      wxLuaCheckStack::DumpTable(int, wxString const&, wxString const&, wxSortedArrayString&, int) in wxldebug.cpp.o
      wxLuaCheckStack::DumpTable(wxString const&, wxString const&) in wxldebug.cpp.o
      ...
  "_lua_rawequal", referenced from:
      wxLuaState::lua_RawEqual(int, int) const in wxlstate.cpp.o
  "_lua_rawget", referenced from:
      wxLuaDebugTarget::LuaDebugHook(lua_State*, lua_Debug*) in wxldtarg.cpp.o
      wxLuaDebugTarget::LuaPrint(lua_State*) in wxldtarg.cpp.o
      wxLuaDebugTarget::GetDebugTarget(lua_State*) in wxldtarg.cpp.o
      wxLuaDebugData::EnumerateTable(lua_State*, int, int, wxArrayInt&) in wxldebug.cpp.o
      wxLuaCheckStack::DumpTable(wxString const&, wxString const&) in wxldebug.cpp.o
      wxLuaStackDialog::RemoveAllLuaReferences() in wxlstack.cpp.o
      wxlua_wxLuaBindMethod_table__index(lua_State*) in wxlbind.cpp.o
      ...
  "_lua_rawgeti", referenced from:
      wxLua_ListCompareFunction(long, long, long) in wxcore_controls.cpp.o
      wxLua_wxBitmapFromBitTable_constructor(lua_State*) in wxcore_gdi.cpp.o
      wxluaR_getref(lua_State*, int, void*) in wxllua.cpp.o
      wxluaT_newmetatable(lua_State*, int) in wxllua.cpp.o
      wxluaT_getmetatable(lua_State*, int) in wxllua.cpp.o
      wxlua_getchararray(lua_State*, int, int&) in wxllua.cpp.o
      wxlua_getwxArrayString(lua_State*, int) in wxllua.cpp.o
      ...
  "_lua_rawset", referenced from:
      wxLuaBinding_wxbase::RegisterBinding(wxLuaState const&) in wxbase_bind.cpp.o
      wxLuaDebugTarget::wxLuaDebugTarget(wxLuaState const&, wxString const&, int) in wxldtarg.cpp.o
      wxlua_wxLuaBindMethod_table__newindex(lua_State*) in wxlbind.cpp.o
      wxLuaBinding::RegisterBinding(wxLuaState const&) in wxlbind.cpp.o
      wxLuaBinding::DoRegisterBinding(wxLuaState const&) const in wxlbind.cpp.o
      wxLuaBinding::InstallClassMetatable(lua_State*, wxLuaBindClass const*) in wxlbind.cpp.o
      wxLuaBinding::InstallClass(lua_State*, wxLuaBindClass const*) in wxlbind.cpp.o
      ...
  "_lua_rawseti", referenced from:
      wxLua_wxDataObject_GetAllFormats(lua_State*) in wxcore_clipdrag.cpp.o
      wxLua_wxDropFilesEvent_GetFiles(lua_State*) in wxcore_clipdrag.cpp.o
      wxLua_wxTreeCtrl_GetSelections(lua_State*) in wxcore_controls.cpp.o
      wxLua_wxTreeListCtrl_GetSelections(lua_State*) in wxcore_controls.cpp.o
      wxluaT_newmetatable(lua_State*, int) in wxllua.cpp.o
      wxlua_pushwxArrayStringtable(lua_State*, wxArrayString const&) in wxllua.cpp.o
      wxlua_pushwxArrayInttable(lua_State*, wxArrayInt const&) in wxllua.cpp.o
      ...
  "_lua_remove", referenced from:
      wxLuaCheckStack::DumpTable(wxString const&, wxString const&) in wxldebug.cpp.o
      wxlua_wxLuaBindClass__newindex(lua_State*) in wxlbind.cpp.o
      wxlua_wxLuaBindMethod_table__call(lua_State*) in wxlbind.cpp.o
      wxlua_wxLuaBindMethod_table__newindex(lua_State*) in wxlbind.cpp.o
      wxluaR_getref(lua_State*, int, void*) in wxllua.cpp.o
      wxluaO_istrackedweakobject(lua_State*, void*, int, bool) in wxllua.cpp.o
      wxluaT_getmetatable(lua_State*, int) in wxllua.cpp.o
      ...
  "_lua_replace", referenced from:
      wxLuaState::lua_Replace(int) in wxlstate.cpp.o
  "_lua_resume", referenced from:
      wxLuaState::lua_Resume(int) in wxlstate.cpp.o
  "_lua_setfenv", referenced from:
      wxLuaState::lua_SetFenv(int) in wxlstate.cpp.o
  "_lua_setfield", referenced from:
      wxLuaDebugTarget::wxLuaDebugTarget(wxLuaState const&, wxString const&, int) in wxldtarg.cpp.o
      wxlua_pushargs(lua_State*, wchar_t**, int, int) in wxllua.cpp.o
      wxLuaState::Create(lua_State*, int) in wxlstate.cpp.o
      wxLuaState::RegisterFunction(int (*)(lua_State*), char const*) in wxlstate.cpp.o
      wxLuaState::lua_SetField(int, char const*) in wxlstate.cpp.o
      wxLuaState::lua_Register(char const*, int (*)(lua_State*)) in wxlstate.cpp.o
      wxLuaState::lua_SetGlobal(char const*) in wxlstate.cpp.o
      ...
  "_lua_sethook", referenced from:
      wxLuaDebugTarget::wxLuaDebugTarget(wxLuaState const&, wxString const&, int) in wxldtarg.cpp.o
      wxlua_debugHookFunction(lua_State*, lua_Debug*) in wxlstate.cpp.o
      wxLuaState::ClearDebugHookBreak() in wxlstate.cpp.o
      wxLuaState::DebugHookBreak(wxString const&) in wxlstate.cpp.o
      wxLuaState::SetLuaDebugHook(int, int, int, bool) in wxlstate.cpp.o
      wxLuaState::lua_SetHook(void (*)(lua_State*, lua_Debug*), int, int) in wxlstate.cpp.o
  "_lua_setlocal", referenced from:
      wxLuaState::lua_SetLocal(lua_Debug const*, int) in wxlstate.cpp.o
  "_lua_setmetatable", referenced from:
      wxlua_userdata_delete(lua_State*) in wxlbind.cpp.o
      wxLuaBinding::InstallClass(lua_State*, wxLuaBindClass const*) in wxlbind.cpp.o
      wxluaO_untrackweakobject(lua_State*, void*, void*) in wxllua.cpp.o
      wxluaO_trackweakobject(lua_State*, int, void*, int) in wxllua.cpp.o
      wxluaT_setmetatable(lua_State*, int) in wxllua.cpp.o
      wxluaT_pushuserdatatype(lua_State*, void const*, int, bool, bool) in wxllua.cpp.o
      wxLuaState::Create(lua_State*, int) in wxlstate.cpp.o
      ...
  "_lua_settable", referenced from:
      wxLuaState::lua_SetTable(int) in wxlstate.cpp.o
  "_lua_settop", referenced from:
      wxLuaHtmlWindow::OnCellClicked(wxHtmlCell*, int, int, wxMouseEvent const&) in wxhtml_wxlhtml.cpp.o
      wxLuaHtmlWindow::OnCellMouseHover(wxHtmlCell*, int, int) in wxhtml_wxlhtml.cpp.o
      wxLuaHtmlWindow::OnLinkClicked(wxHtmlLinkInfo const&) in wxhtml_wxlhtml.cpp.o
      wxLuaHtmlWindow::OnSetTitle(wxString const&) in wxhtml_wxlhtml.cpp.o
      wxLua_ListCompareFunction(long, long, long) in wxcore_controls.cpp.o
      wxLua_wxBitmapFromBitTable_constructor(lua_State*) in wxcore_gdi.cpp.o
      wxLua_wxCreateMenu_constructor(lua_State*) in wxcore_menutool.cpp.o
      ...
  "_lua_setupvalue", referenced from:
      wxLuaState::lua_SetUpvalue(int, int) in wxlstate.cpp.o
  "_lua_status", referenced from:
      wxLuaStateRefData::CloseLuaState(bool) in wxlstate.cpp.o
      wxLuaState::lua_Status() in wxlstate.cpp.o
  "_lua_toboolean", referenced from:
      wxLuaDebugData::GetTypeValue(lua_State*, int, int*, wxString&) in wxldebug.cpp.o
      wxlua_getbooleantype(lua_State*, int) in wxllua.cpp.o
      wxlua_getintegertype(lua_State*, int) in wxllua.cpp.o
      wxlua_getuintegertype(lua_State*, int) in wxllua.cpp.o
      wxlua_getnumbertype(lua_State*, int) in wxllua.cpp.o
      wxlua_getcallbaseclassfunction(lua_State*) in wxllua.cpp.o
      wxLuaObject::GetBoolPtr(lua_State*) in wxlobject.cpp.o
      ...
  "_lua_tocfunction", referenced from:
      wxLuaState::lua_ToCFunction(int) const in wxlstate.cpp.o
  "_lua_tointeger", referenced from:
      wxLuaState::lua_ToInteger(int) const in wxlstate.cpp.o
  "_lua_tolstring", referenced from:
      wxLua_wxStyledTextCtrl_PrivateLexerCall(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxStyledTextCtrl_SetStyleBytes(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxDataObject_SetData(lua_State*) in wxcore_clipdrag.cpp.o
      wxLua_wxDataObjectSimple_SetData(lua_State*) in wxcore_clipdrag.cpp.o
      wxLua_wxPalette_Create(lua_State*) in wxcore_gdi.cpp.o
      wxLua_wxBitmapFromBits_constructor(lua_State*) in wxcore_gdi.cpp.o
      wxLua_wxBitmap_constructor2(lua_State*) in wxcore_gdi.cpp.o
      ...
  "_lua_tonumber", referenced from:
      wxLua_wxStyledTextCtrl_SetStyleBytes(lua_State*) in wxstc_bind.cpp.o
      wxLua_wxHtmlWindow_SetFonts(lua_State*) in wxhtml_bind.cpp.o
      wxLua_wxHtmlWinParser_SetFonts(lua_State*) in wxhtml_bind.cpp.o
      wxLuaHtmlWindow::OnCellClicked(wxHtmlCell*, int, int, wxMouseEvent const&) in wxhtml_wxlhtml.cpp.o
      wxLua_wxGrid_GetCellAlignment(lua_State*) in wxadv_bind.cpp.o
      wxLua_wxGrid_GetCellSize(lua_State*) in wxadv_bind.cpp.o
      wxLua_ListCompareFunction(long, long, long) in wxcore_controls.cpp.o
      ...
  "_lua_topointer", referenced from:
      wxLuaDebugData::GetTypeValue(lua_State*, int, int*, wxString&) in wxldebug.cpp.o
      wxLuaDebugData::GetTableInfo(lua_State*, int) in wxldebug.cpp.o
      wxlua_getpointertype(lua_State*, int) in wxllua.cpp.o
      wxLuaState::lua_ToPointer(int) const in wxlstate.cpp.o
  "_lua_tothread", referenced from:
      wxLuaState::lua_ToThread(int) const in wxlstate.cpp.o
  "_lua_touserdata", referenced from:
      wxLuaDebugTarget::LuaDebugHook(lua_State*, lua_Debug*) in wxldtarg.cpp.o
      wxLuaDebugTarget::LuaPrint(lua_State*) in wxldtarg.cpp.o
      wxLuaDebugTarget::GetDebugTarget(lua_State*) in wxldtarg.cpp.o
      wxLuaDebugData::EnumerateTable(lua_State*, int, int, wxArrayInt&) in wxldebug.cpp.o
      wxLuaDebugData::GetUserDataInfo(lua_State*, int, bool) in wxldebug.cpp.o
      wxlua_wxLuaBindClass__gc(lua_State*) in wxlbind.cpp.o
      wxlua_wxLuaBindClass__index(lua_State*) in wxlbind.cpp.o
      ...
  "_lua_type", referenced from:
      wxLua_wxHtmlCell_Find(lua_State*) in wxhtml_bind.cpp.o
      wxLua_wxHtmlWindow_SetFonts(lua_State*) in wxhtml_bind.cpp.o
      wxLua_wxHtmlWinParser_SetFonts(lua_State*) in wxhtml_bind.cpp.o
      wxLua_wxStatusBar_SetFieldsCount(lua_State*) in wxcore_appframe.cpp.o
      wxLua_wxListCtrl_SortItems(lua_State*) in wxcore_controls.cpp.o
      wxLua_wxBitmapFromBitTable_constructor(lua_State*) in wxcore_gdi.cpp.o
      wxLua_wxCreateMenu_constructor(lua_State*) in wxcore_menutool.cpp.o
      ...
  "_lua_typename", referenced from:
      wxlua_argerror(lua_State*, int, wxString const&) in wxllua.cpp.o
      wxlua_luaL_typename(lua_State*, int) in wxllua.cpp.o
      wxLuaState::lua_TypeName(int) const in wxlstate.cpp.o
      wxLua_function_type(lua_State*) in wxlua_bind.cpp.o
  "_lua_xmove", referenced from:
      wxLuaState::lua_XMove(wxLuaState const&, int) in wxlstate.cpp.o
  "_lua_yield", referenced from:
      wxLuaState::lua_Yield(int) in wxlstate.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/Release/libwx.dylib] Error 1
make[1]: *** [modules/luamodule/CMakeFiles/wxLuaModule.dir/all] Error 2
make: *** [all] Error 2

PS
Paul, can you check wx.dylib dependencies with "otool -L" on macOS?

@pkulchenko
Copy link
Owner

I think, the reason of linking error is, that static (archive) liblua5.1.a used in my configuration instead of liblua.dylib in your configuration.

But you do want to reference an external library, right? Or are you trying to build a static executable?

Paul, can you check wx.dylib dependencies with "otool -L" on macOS?

It has a long list of framework libraries (with libSystem, libiconv, libc++, and libobjc), but nothing lua-related.

" -DwxLua_LUA_LIBRARY=$install_dir/lib/liblua5.1.a".

Why don't you want to reference liblua.dylib?

@Oozlum
Copy link

Oozlum commented Oct 18, 2019

I was asking if it worked without the fix because: According to http://lua-users.org/wiki/BuildingModules modules should not link against lualib except for windows.
I could check this is true on linux.

I agree with @sonoro1234. I think you should not link against liblua and rather specify -Wl,-undefined,dynamic_lookup so the library resolves those symbols against the executable at runtime.

ld: symbol(s) not found for architecture x86_64

This suggests that you are mixing 32- and 64-bit libraries. You are compiling a 64-bit library, but if you run file liblua.dylib I suspect you'll find it is 32-bit.

@pkulchenko
Copy link
Owner

@valid-ptr, closing this one, as I don't see this as an issue. Feel free to re-open if you have any new information.

@pkulchenko pkulchenko closed this Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants