lua-users home
lua-l archive

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


That's the problem. I have no error. There are two files: test.exe and test.lua. When I execute test.exe, I have no errors. If it doesn't occur automatically, also I do know how to capture Lua's erros in a embedded program. The fact is that I have no errors and path doesn't seem to be added. When I type at the Windows console 'c:>path", among the listed folders, there isn't the added one.
The worst thing is not have an error when in fact the error exists.
As I said, I have no erros, simple typing test.exe at the console the interface built with IUP doesn't open.

----- Original Message ----- From: "Wesley Smith" <wesley.hoke@gmail.com>
To: "Lua list" <lua@bazar2.conectiva.com.br>
Sent: Thursday, December 31, 2009 5:07 PM
Subject: Re: Adding new paths for the access of embedded programs


print out the error the Lua gives you.  It will tell you the search
paths it looked for your modules in.

wes

On Thu, Dec 31, 2009 at 11:02 AM, Luciano de Souza
<luchyanus@predialnet.com.br> wrote:
I can't understand why, but unfortunately it didn't work. Let me show you
the first lines of my script. In c:\arquivos de programas\iup are the DLL
for IUP. Therefore, the program should be successfu in accesssing the
libraries from another folder called c:\test where I have only the
executable that fires the program and the script Lua calling the DLLs.

require('package')

path = 'c:\arquivos de programas\iup"

if not string.find(package.path, path, 0, true) then

package.path = string.format("%s/?.lua;%s", path, package.path)

package.path = string.format("%s/?/init.lua;%s", path, package.path)

package.cpath = string.format("%s/?.dll;%s", path, package.cpath)

end

require('iuplua')

require('iupluacontrols')



----- Original Message ----- From: "Wesley Smith" <wesley.hoke@gmail.com>
To: "Lua list" <lua@bazar2.conectiva.com.br>
Sent: Thursday, December 31, 2009 3:11 PM
Subject: Re: Adding new paths for the access of embedded programs


Would this work?

function addmodulepath(path)
-- add to package paths (if not already present)
if not string.find(package.path, path, 0, true) then
package.path = string.format("%s/?.lua;%s", path, package.path)
package.path = string.format("%s/?/init.lua;%s", path, package.path)
package.cpath = string.format("%s/?.dll;%s", path, package.cpath)
end
end


On Thu, Dec 31, 2009 at 9:07 AM, Luciano de Souza
<luchyanus@predialnet.com.br> wrote:

Hello listers,

I'm embedding a Lua script in a Pascal program. The script calls
functions
from LuaSQL, consequently, the respective DLLs must be available. I could place then in the current directory, but regarding that I have 48 further
DLLs related to IUP, to concentrate everything in the current directory
is
not a good idea. So I want to create one directory pur application and
place
all the necessary libraries in a separated path. But how to do it?

I tried the more obvious solution, adding the libraries' folder to the
Windows path. Surprisely, this procedure didn't work! The programs only
can
be executed if the libraries are all present in the current directory.
For
this reason, I ask:

1. How can I add a path to a Lua script allowing it to find the necessary
DLLs in a folder different from the current one?

2. Is this procedure equals for static libraries, in other words, for
another scripts called by "require"?