Hi,
I am trying to load the example lproc program (described on Programming Lua, Chapter 30) into Lua and fouling up somehow. I am following this - http://www.lua.org/pil/26.2.html to get my c module into lua. Following are the steps that I've taken:
I have an lproc.h and lproc.c (containing exactly the functions laid out in Chapter 30 of the book). I am compiling lproc.c as --- gcc -c lproc.c -DLUA-USERCONFIG=\"lproc.h\"
I made a library out of lproc.o, named the same.
And then compiled lua.c as instructed. My header files contain the macro LUA_EXTRALIBS and the method declarations.
Went to the Lua interpreter and it gave the following errors:
> require "lproc" stdin:1: module 'lproc' not found: no field package.preload['lproc'] no file './lproc.lua' no file '/opt/local/share/lua/5.1/lproc.lua' no file '/opt/local/share/lua/5.1/lproc/init.lua' no file '/opt/local/lib/lua/5.1/lproc.lua' no file '/opt/local/lib/lua/5.1/lproc/init.lua' no file './lproc.so' no file '/opt/local/lib/lua/5.1/lproc.so' no file '/opt/local/lib/lua/5.1/loadall.so' stack traceback: [C]: in function 'require' stdin:1: in main chunk [C]: ?
It seems that the module did not get registered, what would I need to do from Lua? Time is short and I am doing something horrendously wrong, any direction would be welcome.
Thanks,
Sayan