lua-users home
lua-l archive

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

Well, now it's easier to ask for help because I finally understood the problem. Getting the error left in the top of the stack, I could verify the problem is at least one file could not be opened.

Cutting and copying DLLs from the DLLs directory to the current directory, I conclude the executable can find lua51.dll and probably most of files. However, two files cannot be opened: iuplua.dll and iupluacontrols, despite both are included in the path.

I believe is not coincidence the fact that the two DLLs are called by the instruction "require":



Usually, the instruction "require" receives as argument the name of a Lua script, Internally, I don't know how the stack can distinguish one from another.

Without excessive hopeness, I tried to open the libraries inside the Pascal code, doing:



It doesn't work of course. If I copy the two DLLs to the current directory, the program executes normly, but I would understand exactly the reason I could not leave then in the DLLs directory.

The precise error text is:


An unhandled exception occurred at $004015A8 :

EInOutError : File not open


----- Original Message ----- From: "Graham Wakefield" <>
To: "Lua list" <>
Sent: Friday, January 01, 2010 4:32 PM
Subject: Re: Adding new paths for the access of embedded programs

On Dec 31, 2009, at 12:15 PM, Luciano de Souza wrote:

lua_pcall(l, 0, 0, 0);

Change this to (the equivalent in Pascal):

if (lua_pcall(l, 0, 0, 0)) {
printf("error: %s\n", lua_tostring(L, -1));

(if lua_pcall triggers an error, it returns non-zero and leaves the error message at stack index -1)



----- Original Message ----- From: "Wesley Smith" <
To: "Lua list" <>
Sent: Thursday, December 31, 2009 5:47 PM
Subject: Re: Adding new paths for the access of embedded programs

if you require a module and Lua can't find it then you definitely  have
errors.  You just need to read up on the Lua documentation to figure
out how to get them.  How are you loading your Lua code?