Closed tastyminerals closed 6 years ago
oh, that was due to local utf8 = require 'lua-utf8'
.
When I switch to utf8 = require 'lua-utf8'
, everything works.
lua_tointeger() is a symbol in Lua5.3, but not before.
if you use Lua 5.3, and compile lua-utf8 for it, the lua-utf8.so will require lua executable export this symbol. if you compile lua-utf8 for other Lua version, it's not needed.
Sorry, what does "symbol in Lua 5.3" mean?
Lua is a library that export it's interface to outside world. When in Windows, lua53.dll exports it's lua* functions as DLL export symbol. and in Linux. we usually static build Lua into one executable. This executable (usually named "lua") export lua* functions as the global symbol of executable file (which is support by ELF file format in Linux). So In Linux, a C module loaded in Lua will look into global namespace to find lua_* functions to use. lua_tointeger() is a macro in Lua 5.1 and Lua 5.2, but in Lua 5.3 it became a real function, means if you compile any module against Lua 5.3, the module will find lua_tointeger() symbol in global namespace, If it can find, the load will failure.
Default interpreter lua5.3, Using snippet:
produces the following error: