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

Post your Gambas programming questions here.
Post Reply
User avatar
PJBlack
Posts: 110
Joined: Tuesday 09th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

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

Post by PJBlack » Tuesday 26th January 2021 4:07pm

i know how to do this in c or cpp but with gambas ??? no idea :(

User avatar
stevedee
Posts: 379
Joined: Monday 20th March 2017 6:06pm

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

Post by stevedee » Tuesday 26th January 2021 4:50pm

I think you just reference each library in the other library's list.

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

User avatar
PJBlack
Posts: 110
Joined: Tuesday 09th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

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

Post by PJBlack » Tuesday 26th January 2021 4:54pm

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

User avatar
stevedee
Posts: 379
Joined: Monday 20th March 2017 6:06pm

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

Post by stevedee » Tuesday 26th January 2021 5:13pm

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.

User avatar
stevedee
Posts: 379
Joined: Monday 20th March 2017 6:06pm

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

Post by stevedee » Tuesday 26th January 2021 5:35pm

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

User avatar
PJBlack
Posts: 110
Joined: Tuesday 09th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

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

Post by PJBlack » Tuesday 26th January 2021 6:33pm

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!

Post Reply