From: Hakki D. <dog...@tr...> - 2006-05-18 08:06:04
|
Hi, John Labenski yazmış: > On 5/17/06, Francesco Montorsi <f18...@ya...> wrote: >> Hi, >> I'm experimenting with wx module and I've got a few proposals for it: >> >> 1) the luamodule.wx.lua files in wxLua/apps/luamodule/src is an example, >> isn't it ? Shouldn't then go in wxLua/samples ? >> wrapmodule.wx.lua is an utility so shouldn't it got in wxLua/utils ? > > Eh... I think these are pretty specialized. But, you're probably > right, once things work they should be moved. I just put them into the > dir where I generated the shared lib since I was having trouble with > the paths for require. > >> 2) I'm getting a weird behaviour of lua's require: I'd like to make the >> "luamodule" app installable in $prefix/lib/lua/5.1; however, while >> everything works as expected if I put the compiled wx.so in >> /usr/local/lib/lua/5.1, it doesn't work if I put it in /usr/lib/lua/5.1: > > This is the path stuff I was talking about, it's a nightmare. > >> wxlua-lua: luamodule.wx.lua:17: module 'wx' not found: >> no field package.preload['wx'] >> no file './wx.so' >> no file '/usr/local/lib/lua/5.1/wx.so' >> no file '/usr/local/lib/lua/5.1/loadall.so' >> stack traceback: >> [C]: in function 'require' >> luamodule.wx.lua:17: in main chunk >> [C]: ? >> >> I tried to set LUA_PATH in luamodule.wx.lua to: >> LUA_PATH="/usr/lib/lua/5.1/?.so;" >> *before* the require() call but then I get: >> >> wxlua-lua: error loading module 'wx' from file '/usr/lib/lua/5.1/wx.so': >> /usr/lib/lua/5.1/wx.so:1: unexpected symbol near 'char(127)' >> stack traceback: >> [C]: ? >> [C]: in function 'require' >> luamodule.wx.lua:17: in main chunk >> [C]: ? >> >> that "unexpected symbol near 'char(127)'" is not clear to me ! >> >> This strange behaviour (lua bug?) is easy to reproduce also putting the >> wx.so file in /usr/local/lib/lua/5.1 and then setting: >> >> LUA_PATH="/usr/local/lib/lua/5.1/?.so" >> >> So, it looks that the global variable LUA_PATH, described at >> http://www.lua.org/pil/8.1.html, does not work... is anyone able to >> reproduce this "bug" ? > > LUA_PATH, I think, is a 5.0 thing, but recently Ray added some code in > our version of lua to handle it. Hopefully he (or anyone else) > understands what this is all about? I've spent far too much time > trying to understand the PATH thing and got nowhere. > > I was hoping that the people who requested that require work w/ wxLua > would step forward and finish things. :) > > Regards, > John Labenski > [snip] I'm using paths like this (on winxp): DSASPATH = "c:/a_C/dsas/server/" package.path = DSASPATH.."?;"..DSASPATH.."?.lua;"..DSASPATH.."/apps/?;"..DSASPATH.."/apps/?.lua" package.cpath = DSASPATH.."?;"..DSASPATH.."?.dll;"..DSASPATH.."/apps/?;"..DSASPATH.."/apps/?.dll" require("testapp") -- API testing ... -- Regards, Hakki Dogusan |