[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to register lpeg.so to Lua ?
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 4 Mar 2010 13:49:56 +0200
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.