|
I don't know what you mean with export the symbols form the executable.
You need to pass the -E option to the linker when you create your statically-linked Lua binary. (If linking using the 'gcc' command, then use '-Wl,-E' to pass the -E onwards from gcc to ld.)
This tells the linker to export the symbols in the static binary. This means that .so files you load later can link back to functions and variables in the original binary...
If you don't export the lua_ and luaL_ symbols from the static binary, then the shared libraries you load later won't be able to find the Lua API functions (even though they are already in memory) and you will get the errors you have here.
Check out the Makefile which comes with Lua itself for advice on the compile and link options you need.