|
> Compiling with this statement:
> gcc -g -Wall -shared -fPIC example1.c luamodule.c -o example2.so
> -I/usr/include/lua5.2 -llua5.2 -lm -ldl
This is confusing. What is in example1.c?
Also, I don't think you need -llua5.2 -lm -ldl.
You may end up with a copy of the Lua runtime in example2.so.
You may want to have a look at my libraries and their Makefiles:
http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/
Look at a simple one like lbase64 or lrandom.
You may need to add -fPIC to CFLAGS and MAKESO.