|
|
||
|
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" <[email protected]>
To: "Lua list" <[email protected]> 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 <[email protected]> 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" <[email protected]> To: "Lua list" <[email protected]> Sent: Thursday, December 31, 2009 3:11 PM Subject: Re: Adding new paths for the access of embedded programsWould 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 <[email protected]> wrote:Hello listers, I'm embedding a Lua script in a Pascal program. The script calls functionsfrom LuaSQL, consequently, the respective DLLs must be available. I could place then in the current directory, but regarding that I have 48 furtherDLLs 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 necessaryDLLs 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"?