lua-users home
lua-l archive

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



On Mon, Nov 3, 2008 at 2:19 AM, 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...
>

I have Ubuntu 8.04, and liblua5.1-bit0 installed. require("bit") works
just fine. I note though that you have Lua 5.1.1, yet 5.1.2 is the
latest in the Ubuntu repositories as far as I know...

Yes, that was the culprit. For unknown reason, I had /usr/bin/lua5.1 (version 5.1.2 of Lua) but I also had "/usr/bin/lua" which was not symlink to Lua5.1 but binary of older Lua (5.1.1). I have no idea how this happened. I never touched these things and I didn't install other Lua version than the official 5.1 Ubuntu package. When I completely removed and re-installed Lua5.1 package, it started working. (Re-installing without first removing did NOT work, the old binary stayed in /usr/bin).

The only problem I now have is that "csnd" library does not work after installing package "liblua5.1-csnd". Lua looks for file /usr/lib/lua/5.1/csnd.so, which is a symlink to /usr/lib/libcsnd.so - and this file does not exist.
 


Matthew.


------------------------------

Message: 10
Date: Sun, 2 Nov 2008 19:28:32 -0800
From: "Sam Roberts" <vieuxtech@gmail.com>
Subject: Re: How to use Lua libraries in Ubuntu packages?
To: "Lua list" <lua@bazar2.conectiva.com.br>
Message-ID:
       <17eac67c0811021928x1715e13cjf518326dc609b20d@mail.gmail.com">17eac67c0811021928x1715e13cjf518326dc609b20d@mail.gmail.com>
Content-Type: text/plain; charset=WINDOWS-1252

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


------------------------------

Message: 11
Date: Mon, 3 Nov 2008 01:47:14 -0700
From: Etherous <etherous@gmail.com>
Subject: Re: Embedded Lua Linker Errors
To: Lua list <lua@bazar2.conectiva.com.br>
Message-ID: <005AD200-F28D-41CF-AFF2-D921802B7A3E@gmail.com">005AD200-F28D-41CF-AFF2-D921802B7A3E@gmail.com>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

Yeah. I feel stupid, but I think that worked. Thanks!

On Nov 2, 2008, at 1:49 PM, James Dennett wrote:

> On Sun, Nov 2, 2008 at 12:27 PM, Etherous <etherous@gmail.com> wrote:
>> I'm running Mac OS 10.5.5 and Using Xcode 3.1.1 and Lua 5.1.4. I'm
>> trying to
>> embed Lua into my C++ application. When I build it, at the linker
>> stage I
>> get the following errors:
>>  "lua_pcall(lua_State*, int, int, int)", referenced from:
>>      vConsole::run()     in main.o
>
> My best guess: you need
>  extern "C" {
>    ...
>  }
> around your #include of "lua.h", as your lua library has been compiled
> as C, not C++.  (Or you could recompile it as C++, if you prefer.)
>
> -- James



------------------------------

Message: 12
Date: Mon, 3 Nov 2008 13:46:26 +0100
From: "Jerome Vuarand" <jerome.vuarand@gmail.com>
Subject: Re: "Random" delays in execution
To: "Lua list" <lua@bazar2.conectiva.com.br>
Message-ID:
       <89d273ba0811030446j724f565bq66a73f14885340ee@mail.gmail.com">89d273ba0811030446j724f565bq66a73f14885340ee@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

2008/11/1 Max van Rooij (van Rooij Electronics Design & Software
Engineering) <mvrooij@vanrooij-edse.nl>:
> Thanks for the effort you took. Please comment out lines 83 to 86 in
> your Lua.c file and try again (those lines are the my patch to "fix" the
> problem). Use the Lua functions to print mem usage per iteration.

With the GCCOLLECT the memory stays at 26kiB for the number version
and at 231kiB for the userdata version. Without GCCOLLECT it
oscillates at respectively 29-47kiB and 234-253kiB (in sawtooth cycles
with progressive increase and sudden decrease). In any case I didn't
notice any stall.


------------------------------

Message: 13
Date: Mon, 3 Nov 2008 10:47:08 -0200
From: Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>
Subject: Re: Embedded Lua Linker Errors
To: Lua list <lua@bazar2.conectiva.com.br>
Message-ID: <20081103104708.A15158@lua.tecgraf.puc-rio.br">20081103104708.A15158@lua.tecgraf.puc-rio.br>
Content-Type: text/plain; charset=us-ascii

> > My best guess: you need
> >  extern "C" {
> >    ...
> >  }
> > around your #include of "lua.h", as your lua library has been compiled
> > as C, not C++.  (Or you could recompile it as C++, if you prefer.)

Or just use lua.hpp from etc.


End of Lua Digest, Vol 127, Issue 1
***********************************



--
Frantisek Fuka
(yes, that IS my real name)
(and it's pronounced "Fran-tjee-shek Foo-kah")

Jabber/GoogleTalk ID: fuka@fuxoft.cz
Homepage: http://www.fuxoft.cz