On 2/27/06, Marcos <[EMAIL PROTECTED]> wrote:
> I'm compiling wxlua myself.
> I'am using the luasocket 2.0 binary files on win32 (win98).
>
> > I see you load compat-5.1.lua, wxLua is based on 5.0.2, has luasocket
> > been compiled for 5.1?
> No, luasocket was been compiled for 5.0.2, but under compat-5.1 package
> model.
>
> I download your wxLua installer e try ...
>
> the script is:
> ---
> dofile([[D:\lua\lua5\5.0\bin\compat-5.1.lua]] )
> local http = require("socket.http")
> print(http.request)
> b, c, h = http.request("http://www.lua.org";)  print(b,c,h)
> ---
>
> I get this message with lua.exe and wxlua.exe
> ---
> wxLua: Error while running chunk
> compat-5.1.lua:130: error loading package `socket.core' (One of the
> library files needed to run this application cannot be found.
> )
> ---
>
> Now I put lua50.dll (luasocket dependencie ) in /bin, and get this.
> ----
> C:\App\wxLua\test\socket>C:\App\wxLua\bin\lua.exe http1.lua
> function: 00AC4780
> C:\APP\WXLUA\BIN\LUA.EXE: not enough memory
> stack traceback:
>         [C]: in function `request'
>         http1.lua:4: in main chunk
>         [C]: ?
> ---
>
> Note the module was loaded and http.request is a function.

Well, it seems a little closer. I've tried it in linux, I got the
luasocket source compiled it, but I had to make some changes, but it
still doesn't even work using the lua executable.

luasocket.h & luasocket.c I added

LUASOCKET_API int luaopen_socket(lua_State *L);

LUASOCKET_API int luaopen_socket(lua_State *L) {
    return luaopen_socket_core(L);
}

since otherwise I got this error when just running it in lua
../../wxLua/bin/lua:
.../wxLua/luasocket-2.0/src/compat-5.1r4/compat-5.1.lua:125: error
loading package `socket' (./socket.so: undefined symbol:
luaopen_socket)

I tried changing the require code to
local http = require("socket")

to not get the error
../../wxLua/bin/lua:
.../wxLua/luasocket-2.0/src/compat-5.1r4/compat-5.1.lua:171: package
`socket.http' not found

but now I get this error, since it didn't load the http module.
../../wxLua/bin/lua: wxlua_test.lua:9: attempt to call field `request'
(a nil value)

I'm a little unfamiliar with the module way of doing things, but
something not right about the luasocket lib or my paths or...
something. I'm a little suspicious since it was looking for a function
called luaopen_socket which didn't even exist, so I think there may be
other problems in the luasocket module.

It would be nice to get this working in wxLua, but if I can't even get
it to work using lua, I won't be able to make any progress. I'll try
tomorrow in MSW.

Regards,
    John Labenski


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Wxlua-users mailing list
Wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to