lua-users home
lua-l archive

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


On Sun, Nov 2, 2008 at 6:19 PM, František Fuka <fuka@fuxoft.cz> wrote:
> Hello there,
>
> can please someone enlighten me how should I use Lua libraries in existing
> Ubuntu 8.04 packages? I have unmodified Lua 5.1.1 and "bit" Lua library
> installed from Ubuntu packages and yet...

Are you sure you are using the one you installed, and not one from
/usr/local/bin?

> Lua 5.1.1  Copyright (C) 1994-2006 Lua.org, PUC-Rio
>> require("bit")
> stdin:1: module 'bit' not found:
>     no field package.preload['bit']
>     no file './bit.so'
>     no file '/usr/local/lib/lua/5.1/bit.so'
>     no file '/usr/local/lib/lua/5.1/loadall.so'

An ubuntu lua binary should have searched for bit.so in
/usr/lib/lua*/... something.

But yours searched only in /usr/local and the current directory.

Do "which lua" to see which lua you are using.
Do "dpkg -L the_package_name" to see where your lua libraries are.

Figure out where lua searches:

 % lua
Lua 5.1.1  Copyright (C) 1994-2006 Lua.org, PUC-Rio
> print(package.cpath)
./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so
> print(package.path)
./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua