Still get the same liblua error though
why you still getting this error is because for some reason lua make rules doesn't compile a shared library, only static.
here is how you can solve this:
navigate to lua source root folder, then uninstall what you've done before
Code:
cd lua/source/dir
sudo make uninstall # you need root access
make clean
now we need to create a rule to build a shared library, if you're lazy i've uploaded both Makefiles(note: lua version 5.2.4) rules you need, just copy and paste contents to Makefile and src/Makefile and skip to the end.
Makefile · GitHub
if you want to do by hand continue following these steps
open make rules inside src/ folder
note that vi is edtior i'm used to, open with yours, if not used to any, i suggest you open with nano src/Makefile
add -fPIC option to compiler, at the end of CFLAGS var.
CFLAGS= -O2 -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS) -fPIC
create a new var to hold yoru file output name
LUA_SHARED_OBJECT= liblua5.2.so
add to end of ALL_T var our shared object
ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SHARED_OBJECT)
create a new target for our shared object, so make call compiler to handle it
$(LUA_SHARED_OBJECT): $(CORE_O) $(LIB_O)
$(CC) -o $@ -shared $?
save the file and you're good to go.
if you want to make install your .so file to your system shared library folder then open Makefile that lives in lua root folder
vi Makefile
in TO_LIB add our .so file
TO_LIB= liblua.a liblua5.2.so
save the file and:
if test success (you see lua version output), notice you need root access now.
again, these makefiles are from lua 5.2.4, so be careful if you're with other version, good lucky =)