module problem

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

module problem

Robert Hibberdine
Hi all,

I've written a few simple apps in lua and they run fine on both my PC and the target embedded system. I then decided to reorganise these apps splitting them up into modules etc.. Now everything works fine on the PC but when I run them on the embedded system I get errors.

Specifically, if I call a function in one of my modules and that function uses one of the built-in library functions such as 'print' I get an errror "attempt to call global 'print' (a nil value)"

If I call 'print'  from my  "main" lua program there is no problem...

As I said everything works fine on the PC but not on the target system. I am using Lua 5.0 with the compat 5.1 stuff.

I have obviously somehow broken my setup on the embedded system. The problem is I don't really understand what is happenning here...

Any ideas???

Many thanks in advance

Bob



Reply | Threaded
Open this post in threaded view
|

RE: module problem

Daniel Collins
It sounds like something has happened to the global table, as if the
modules are running in an unintentional sandbox, but only on the
embedded platforms.

I have no idea how this is happening though but it's a start.

- DC


Reply | Threaded
Open this post in threaded view
|

Re: module problem

Petite Abeille
In reply to this post by Robert Hibberdine

On Jun 02, 2006, at 11:02, Robert Hibberdine wrote:

Any ideas???

http://www.lua.org/manual/5.1/manual.html#pdf-package.seeall

As in:

module( "mymodule", package.seeall )

Cheers

--
PA, Onnay Equitursay
http://alt.textdrive.com/


Reply | Threaded
Open this post in threaded view
|

Re: module problem

Robert Hibberdine
Many thanks. That worked a treat. Although now I don't understand why that option was not requred on the PC...????

Bob

PA wrote:



As in:

module( "mymodule", package.seeall )

Cheers

--
PA, Onnay Equitursay
http://alt.textdrive.com/




Reply | Threaded
Open this post in threaded view
|

Re: module problem

Petite Abeille

On Jun 02, 2006, at 11:21, Robert Hibberdine wrote:

Many thanks. That worked a treat. Although now I don't understand why that option was not requred on the PC...????

Perhaps you are using different package implementations (e.g. Kepler's Compat-5.1) and/or VM version?

Cheers

--
PA, Onnay Equitursay
http://alt.textdrive.com/


Reply | Threaded
Open this post in threaded view
|

Re: module problem

Robert Hibberdine

Perhaps you are using different package implementations (e.g. Kepler's Compat-5.1) and/or VM version?

Ahh yes, that's it. I am using Kepler stuff on  the embedded target..

Thanks again for the prompt rescue job :-).

Bob