<div dir="ltr"><div dir="ltr">Hi Lee,<br>I don't know how to respond to your comments, let's see what Benoit has to say, the wiki page (unknown to me until now) seems to conflict with the last code I posted (see my post with 'Dynamic libraries' attached).<br>Probably because it refers to the libraries loaded through the IDE dialog.<br>The code: Object.Call(Module1, "Main"), I think works because it is inserted in the Sub Main (try to double click on the library).<br><br>Regards<br>Gianluigi<br></div></div><br><div class="gmail_quote"><div dir="ltr">Il giorno lun 22 ott 2018 alle ore 20:51 T Lee Davidson <<a href="mailto:t.lee.davidson@gmail.com">t.lee.davidson@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yes, Gianluigi, that code does work.<br>
<br>
Interestingly, with the library located within the project directory, I was able to load it with, literally,<br>
'Component.Load("/doesnotexist/myLibrary")'. But, it would not find it with the path specified as "myLibrary", "../myLibrary",<br>
or "./myLibrary".<br>
<br>
Apparently, since it could not be found at a path that does not exist, Gambas then applied the Library Search Paths [0] finding<br>
the library in the first path searched, the project directory. However, if the library is not in the project directory and since<br>
Gambas does not know its vendor, the library cannot be found in (regexp expressed):<br>
($XDG_DATA_HOME | ~/.local/share)/gambas3/lib/<vendor>/<name>:<version>.gambas<br>
or any of the other search paths since they also rely on <vendor>.<br>
<br>
<br>
And that brings up a question.<br>
<br>
Reference [0] states, "When a project that depends on a library is executed, the library executable is searched for in the<br>
following paths [...]"<br>
<br>
Now, for a project to 'know' that it depends on a library, the library must be specified in the Project properties Libraries<br>
tab, correct? And, if that is done, then the project would already 'know' the location of the library.<br>
<br>
So then, why the need for search paths?<br>
<br>
If the search paths are to facilitate dynamic loading of libraries, then all but one path would be guaranteed to fail to produce<br>
results since the vendor of the library would not be known unless somehow specified.<br>
<br>
Is it supposed to be possible to load a library by specifying its name as "<vendor>/<name>" or "<vendor>/<name>:<version>" [ie.<br>
Component.Load("gambasbook_de/myLibrary)]?<br>
<br>
<br>
[0] <a href="http://gambaswiki.org/wiki/doc/library#t2" rel="noreferrer" target="_blank">http://gambaswiki.org/wiki/doc/library#t2</a><br>
<br>
<br>
___<br>
Lee<br>
<br>
P.S. Gianluigi, calling the Main method of Class.Load[ed] Module1 also works as:<br>
Dim Module1 As Class<br>
<br>
Module1 = Class.Load("Module1")<br>
Object.Call(Module1, "Main")<br>
<br>
<br>
On 10/21/18 4:31 PM, Gianluigi wrote:<br>
> Hans, Lee,<br>
> this attached code, here works.<br>
> <br>
> Regards<br>
> Gianluigi<br>
> <br>
> Il giorno dom 21 ott 2018 alle ore 20:48 T Lee Davidson <<a href="mailto:t.lee.davidson@gmail.com" target="_blank">t.lee.davidson@gmail.com</a> <mailto:<a href="mailto:t.lee.davidson@gmail.com" target="_blank">t.lee.davidson@gmail.com</a>>> ha scritto:<br>
> <br>
> Actually, "/usr/lib/gambas3/" would be the *system* path where all the components are stored. You get that particular path<br>
> string with Component.Path.<br>
> <br>
> When you make an executable of a library (in this case resulting in "myLibrary.gambas"), a copy is also automatically placed in<br>
> the *user* path:<br>
> <Desktop.DataDir>/gambas3/lib/<vendor_name>/<file_name> (filename in this case is "myLibrary:0.0.gambas").<br>
> <br>
> <br>
> ___<br>
> Lee<br>
> <br>
> <br>
> On 10/21/18 10:42 AM, Gianluigi wrote:<br>
> > As suggested by Benoit and Jussi, the Library should be copied inside the project, then in Sub Open you writs:<br>
> ><br>
> > Dim sPath As String<br>
> > sPath = "/usr/lib/gambas3/myLibrary:0"<br>
> > Component.Load(sPath)<br>
> ><br>
> > and with help from this lesson [0], completes the project.<br>
> ><br>
> > Regards<br>
> > Gianluigi<br>
> <br>
> ----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
> <br>
> <br>
> <br>
> ----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
> <br>
<br>
----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
</blockquote></div>