Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

luasocket 3.0,undefined symbol:lua_callk

I'm using luajit 2.0.3,and I want to use luasocket in myproject.When require socket in jit, it reported an error

"error loading module 'socket.core' from file '/usr/local/lib/lua/5.1/socket/core.so': /usr/local/lib/lua/5.1/socket/core.so: undefined symbol: lua_callk. 

I compiled luasocket 3.0 in debian 5.0 with lua5.1. I searched a lot of answers ,but none helped. I compiled luasocket 3.0 in debian 5.0 with lua5.1.

like image 323
JoeyMiu Avatar asked Jan 25 '26 05:01

JoeyMiu


1 Answers

LuaJIT is ABI-compatible with Lua 5.1, that means, you can compile a C module against the standard Lua headers and either load it from Lua or from LuaJIT.

Judging from the error message, LuaSocket requires the function lua_callk, however, as for today, this function is not implemented in LuaJIT. There has been requests of implementing this function as well as lua_pcallk and lua_yieldk but doing it so would require LuaJIT to switch to the Lua 5.2 ABI [1].

I would suggest you to switch to an older version of LuaSocket (2.0.2, for instance) or check whether LuaSocket can be compiled keeping 5.1 ABI compatibility.

[1] http://www.freelists.org/post/luajit/Yielding-across-C-boundaries,3

like image 170
Diego Pino Avatar answered Jan 26 '26 19:01

Diego Pino



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!