From: John L. <jla...@gm...> - 2006-05-13 21:36:45
|
In the wxLua/apps/luamodule dir is code to make lua require"wx" work in Lin= ux. 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 ps. Francesco can you rebake the files. I have added back the -DWXLUA_CODE define, now called WXLUA_LUA_NEWTHREAD for clarity in modules/build/bakefiles/modules.bkl. We had to remove that previously, but now I see that it's required for using wxLua as a module. Also, about adding this to bakefile? Note: The output must unfortunately be called wx.so since otherwise require"wx" will fail. 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 |
From: John L. <jla...@gm...> - 2006-05-13 21:52:52
|
ps. I've also posted this on <lu...@ba...> to see if anyone there can clarify how to deal with this in MSW. On 5/13/06, John Labenski <jla...@gm...> wrote: > In the wxLua/apps/luamodule dir is code to make lua require"wx" work in L= inux. > > 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 > > ps. Francesco can you rebake the files. I have added back the > -DWXLUA_CODE define, now called WXLUA_LUA_NEWTHREAD for clarity in > modules/build/bakefiles/modules.bkl. We had to remove that previously, > but now I see that it's required for using wxLua as a module. > > Also, about adding this to bakefile? Note: The output must > unfortunately be called wx.so since otherwise require"wx" will fail. > > 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 o= n this? > > Regards, > John Labenski > |
From: Damien F. <dam...@mo...> - 2006-05-14 11:27:30
|
this is great news !!!! our pipeline is strongly based on lua and I can`t wait to put more wxLua in action !! > 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 this worked great , compile and run . but is I try lua luamodule.wx.lua I get an error of type : libwx_gtk2_wxlua-2.6.so: undefined symbol: wxLua_lua_getnewthreadhandler we have the standard lua 5.1 distribution installed , what is exactly the difference beetwen lua 5.1 and lua include the wxLua distribution ? is it only the function enable by the WXLUA_LUA_NEWTHREAD flag ? again thank you for your great work on bringing us wxLua !!!! damien |
From: Francesco M. <f18...@ya...> - 2006-05-14 13:37:43
|
John Labenski ha scritto: > 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. yes, sure > > 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 > > ps. Francesco can you rebake the files. I have added back the > -DWXLUA_CODE define, now called WXLUA_LUA_NEWTHREAD for clarity in > modules/build/bakefiles/modules.bkl. We had to remove that previously, > but now I see that it's required for using wxLua as a module. Done... > > Also, about adding this to bakefile? Note: The output must > unfortunately be called wx.so since otherwise require"wx" will fail. I have a little mess currently with wxWidgets as I have various installed versions and all patched so it will take me a bit before being able to test the bakefiles for luamodule but I've already written the necessary stuff ;) > > 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, yes, sure > linking it with all the other libs, yes but this is a dynamic link (wx.so is only 150K on my system) > and then creating a .so library using -shared. I think also that -fpic > is needed. yes, -fpic is for generating code for shared objects (pic = position independent code)... > > I haven't the foggiest idea about how to do the same in MSW, I guess > it should be a DLL? yes, I think so. >But then how do you "link" this DLL to all of the > wxLua and wxWidgets DLLs using the import libraries generated when creating the DLL (i.e. when you compile with SHARED=1 both .lib and .dll files are created - the .lib are import libraries). >or can you create the wxLua and wxWidgets > libs as libs and link them to the DLL? if I got it right then: no it's not possible. code compiled in "DLL" mode is different from code compiled for static linking. Francesco |
From: Damien F. <dam...@mo...> - 2006-05-15 09:56:13
|
this is great news !!!! our pipeline is strongly based on lua and I can`t wait to put more wxLua in action !! > 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 this worked great , compile and run . but if I try lua luamodule.wx.lua I get an error of type : libwx_gtk2_wxlua-2.6.so: undefined symbol: wxLua_lua_getnewthreadhandler we have the standard lua 5.1 distribution installed , what is exactly the difference beetwen lua 5.1 and lua include the wxLua distribution ? is it only the function enable by the WXLUA_LUA_NEWTHREAD flag ? again thank you for your great work on bringing us wxLua !!!! damien |