Closed sodomon2 closed 3 years ago
@stetre
this is the output of the command pkg-config --cflags --libs lua5.3
-I/usr/include/lua5.3 -L/usr/lib/lua5.3 -llua -lm
Please, try replacing the pkg-config line with the following and let me know if it works
INCDIR = -I/usr/include/lua$(LUAVER)
LIBDIR = -L/usr/lib/lua$(LUAVER)
Ok, I tried it that way and it gives the same errors as without the pkg-conf.
user $ ldd src/moonglfw.so
/lib/ld-musl-x86_64.so.1 (0x7f5309568000)
libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f5309568000)
Error relocating src/moonglfw.so: lua_pcallk: symbol not found
Error relocating src/moonglfw.so: lua_touserdata: symbol not found
Error relocating src/moonglfw.so: lua_pushlightuserdata: symbol not found
Error relocating src/moonglfw.so: lua_getallocf: symbol not found
Error relocating src/moonglfw.so: luaL_ref: symbol not found
Error relocating src/moonglfw.so: lua_seti: symbol not found
Error relocating src/moonglfw.so: luaL_unref: symbol not found
Error relocating src/moonglfw.so: lua_gettop: symbol not found
Error relocating src/moonglfw.so: luaL_checkstack: symbol not found
Error relocating src/moonglfw.so: lua_tointegerx: symbol not found
Error relocating src/moonglfw.so: luaL_checklstring: symbol not found
Error relocating src/moonglfw.so: lua_pushnumber: symbol not found
Error relocating src/moonglfw.so: lua_setfield: symbol not found
Error relocating src/moonglfw.so: lua_pushvalue: symbol not found
Error relocating src/moonglfw.so: luaL_error: symbol not found
Error relocating src/moonglfw.so: lua_geti: symbol not found
Error relocating src/moonglfw.so: lua_settop: symbol not found
Error relocating src/moonglfw.so: lua_pushfstring: symbol not found
Error relocating src/moonglfw.so: luaL_checknumber: symbol not found
Error relocating src/moonglfw.so: lua_tolstring: symbol not found
Error relocating src/moonglfw.so: lua_type: symbol not found
Error relocating src/moonglfw.so: lua_pushboolean: symbol not found
Error relocating src/moonglfw.so: lua_settable: symbol not found
Error relocating src/moonglfw.so: lua_rawseti: symbol not found
Error relocating src/moonglfw.so: luaL_optlstring: symbol not found
Error relocating src/moonglfw.so: lua_isinteger: symbol not found
Error relocating src/moonglfw.so: lua_error: symbol not found
Error relocating src/moonglfw.so: lua_pushstring: symbol not found
Error relocating src/moonglfw.so: luaL_argerror: symbol not found
Error relocating src/moonglfw.so: luaL_checkinteger: symbol not found
Error relocating src/moonglfw.so: luaL_setfuncs: symbol not found
Error relocating src/moonglfw.so: lua_rawgeti: symbol not found
Error relocating src/moonglfw.so: luaL_optinteger: symbol not found
Error relocating src/moonglfw.so: luaL_len: symbol not found
Error relocating src/moonglfw.so: lua_toboolean: symbol not found
Error relocating src/moonglfw.so: lua_createtable: symbol not found
Error relocating src/moonglfw.so: lua_pushinteger: symbol not found
Does it work if you add also the following? (it should)
LIBS= -llua -lm
LIBS= -llua -lm
With this it works, but link the library with lua5.1
LIBS= -llua -lm
With this it works, but link the library with lua5.1
Was it the same with your pkg-config fix? The above INCDIR, LIBDIR and LIBS definitions taken together are exactly the same as the pkg-config output.
I have done it this way
INCDIR = -I/usr/include/lua$(LUAVER)
LIBDIR = -L/usr/lib/lua$(LUAVER) /usr/lib/liblua-$(LUAVER).so.0 -lm
apparently it doesn't give errors when making the library
user $ ldd src/moonglfw.so
/lib/ld-musl-x86_64.so.1 (0x7f4d66183000)
liblua-5.3.so.0 => /usr/lib/liblua-5.3.so.0 (0x7f4d66133000)
libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f4d66183000)
This makes more sense. The LIBDIR definition shouldn't be necessary, then, since the library is in the standard location /usr/lib . To sum up, the original Makefile should work by just adding the definition:
LIBS=/usr/lib/liblua-$(LUAVER).so.0 -lm
Unfortunately this also break the compilation against lualib built from the official package (the linker doesn't like -llua because the official package does't compile with -fPIC).
As a temporary measure, I can add it and comment it out, so you would have to uncomment it after cloning. Is it ok for you?
@stetre OH! sounds good to me
Done. Let me know if it works or not. Thank you.
@stetre OH! yes it works :) now i will close this :)
replaced -I/usr/include/lua$(LUAVER) with
pkg-config --cflags --libs lua$(LUAVER)
.