lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2010/3/4 leeya <leeyacn@126.com>:
> But I did not know how to register lpeg.so to Lua so that I was able to use
> LPeg by interactive ways.

require ("lpeg") is what you need to do.  But first you must move
lpeg.so onto the Lua extension path.

On Linux, usually it is like so:

$ lua -e "print(package.cpath)"
./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so

Which means that you should move lpeg.so to /usr/local/lib/lua/5.1

However, if you are just testing an extension, note the ./?.so: it
means that if you run Lua in the same directory as lfs.so, then
require should work directly.

steve d.