Page 1 of 1

how to program a lib A that depends on another lib B that depends on lib A

Posted: Tuesday 26th January 2021 4:07pm
by PJBlack
i know how to do this in c or cpp but with gambas ??? no idea :(

Re: how to program a lib A that depends on another lib B that depends on lib A

Posted: Tuesday 26th January 2021 4:50pm
by stevedee
I think you just reference each library in the other library's list.

See my post: https://captainbodgit.blogspot.com/2019 ... aries.html

Re: how to program a lib A that depends on another lib B that depends on lib A

Posted: Tuesday 26th January 2021 4:54pm
by PJBlack
no because they can't compile ...

lib A uses libB.job() ... and lib B uses libA.job()

so i cant compile lib A to reference within lib B and i cant compile lib B to reference within lib A

Re: how to program a lib A that depends on another lib B that depends on lib A

Posted: Tuesday 26th January 2021 5:13pm
by stevedee
PJBlack wrote: Tuesday 26th January 2021 4:54pm no because they can't compile ...
Can you give me a code example, so I don't have to write my own.

Re: how to program a lib A that depends on another lib B that depends on lib A

Posted: Tuesday 26th January 2021 5:35pm
by stevedee
One other point; deliberately creating 2 libraries that are mutually dependent upon one another is a bad idea.

See also: https://en.wikipedia.org/wiki/Circular_dependency

Re: how to program a lib A that depends on another lib B that depends on lib A

Posted: Tuesday 26th January 2021 6:33pm
by PJBlack
stevedee wrote: Tuesday 26th January 2021 5:35pm bad idea
my build in mr monk says it's a brilliant idea ... but yes i think you're right and i will thinking about redesigning that stuff.

thanks for your help so far!