Search code examples
linuxlualinux-mint

wxLua 'undefined symbol: luaopen_libwx' (Linux Mint 16)


I had some problems to compile wxLua on Linux and after some hours reading the installation guide, i got the following files:

  • libwx.so
  • libwxlua-wx28gtk2ud-2.8.12.3.so
  • libwxlua_bind-wx28gtk2ud-2.8.12.3.so
  • libwxlua_debug-wx28gtk2ud-2.8.12.3.so
  • libwxlua_debugger-wx28gtk2ud-2.8.12.3.so
  • libwxlua5.2-wx28gtk2ud-2.8.12.3.so
  • libwxstedit-wx28gtk2ud-2.8.12.3.so

simpleui.lua

require("libwx")

frame = nil

function HandleEvents(event)
  local name = event:GetEventObject():DynamicCast("wxWindow"):GetName()
  print(string.format("\\global\\def\\Choice%s{%s}", name, event:GetString()))
end

function main()
  frame = wx.wxFrame(wx.NULL,
                     wx.wxID_ANY,
                     "Erstellen Sie Ihr PDF-Dokument mit LuaTeX",
                     wx.wxDefaultPosition,
                     wx.wxSize(185, 85),
                     wx.wxDEFAULT_FRAME_STYLE)
  local panel = wx.wxPanel(frame, wx.wxID_ANY)
  local choices = {"blue", "red", "green"}
  local radioBox = wx.wxRadioBox(panel,
                                 wx.wxID_ANY,
                                 "Farbe",
                                 wx.wxDefaultPosition,
                                 wx.wxDefaultSize,
                                 choices, 1,wx.wxRA_SPECIFY_ROWS)
  frame:Connect(wx.wxID_ANY,
                wx.wxEVT_COMMAND_RADIOBOX_SELECTED,
                HandleEvents)
  frame:Show(true)
end

main()

wx.wxGetApp():MainLoop()

I copied all files to the same folder, but i doesn't work.

Error:

lua: error loading module 'libwx' from file './libwx.so':
        ./libwx.so: undefined symbol: luaopen_libwx
stack traceback:
        [C]: in ?
        [C]: in function 'require'
        simpleui.lua:1: in main chunk
        [C]: in ?

I am trying to use this in LuaLatex and have some problems on Windows too.


Solution

  • I've solved the Problem.

    Lua is searching for wx.so instead of libwx.so and it works after renaming.