In the wxLua/apps/luamodule dir is code to make lua require"wx" work in Linux. You create the wx.so library by running $make in the wxLua/apps/luamodule/src dir and all of wxLua will be created for you. The output wx.so lib is just dumped in the src

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

In the wxLua/apps/luamodule dir is code to make lua require"wx" work in Linux. You create the wx.so library by running $make in the wxLua/apps/luamodule/src dir and all of wxLua will be created for you. The output wx.so lib is just dumped in the src

John Labenski
You need to use the current CVS HEAD of wxLua. The snapshots are
broken since Sourceforge has changed things recently and I'm not sure
how to reimplement what we had.

In the wxLua/apps/luamodule dir is code to make lua require"wx" work in Linux.

You create the wx.so library by running $make in the
wxLua/apps/luamodule/src dir and all of wxLua will be created for you.
The output wx.so lib is just dumped in the src dir for now.  The
Makefile uses the wx-config script and therefore it MUST be in your
path. Additionally it puts the resultant wxLua libs it creates in the
appropriate lib dir of wxWidgets so it must be writeable. As a
developer I never bother to install wxWidgets, but if you have you'll
have to hack the Makefiles located in each XXX/src dir to output them
elsewhere. The Makefiles are fairly straightforward so this shouldn't
be difficult. Eventually we'll get the bakefile's configure to work
with this new project.

A sample program called luamodule.wx.lua in that dir shows it working
by simply creating a wxFrame. Test it from the
wxLua/apps/luamodule/src dir using
$../../../bin/lua luamodule.wx.lua

-----------------------------------------
Help for MSW

For non wxWidgets, wxLua users: We create 3 libs for wxLua and
wxWidgets itself has about a half a dozen libs that need to be linked
to the resultant shared lib for lua's require, if I understand
correctly.

I don't really understand completely what I've done, but it seems to
work. See apps/luamodule/src/Makefile and the wx.so: tag. I guess I'm
compiling the luamodule.cpp file, linking it with all the other libs,
and then creating a .so library using -shared. I think also that -fpic
is needed.

I haven't the foggiest idea about how to do the same in MSW, I guess
it should be a DLL? But then how do you "link" this DLL to all of the
wxLua and wxWidgets DLLs or can you create the wxLua and wxWidgets
libs as libs and link them to the DLL?

Maybe someone who uses lua's require more regularly can shed some light on this?

Regards,
   John Labenski