A question about libraries
Posted
#1
(In Topic #183)
Regular

I have a library (LibDb) that deals with database functions. Some of those functions need to call functions held in another library(LibXX).
Incorporating LibXX in LibDb causes an error :-
Code
"Cannot load LibXX: unable to load LibXXAny advice would be welcome
Posted
Regular

3 questions:
- What are these external functions?
- Are you "translating" into Gambas a code already written in C ? If "yes", what ?
- Is it possible to have some Gambas code that reproduces that problem?
vuott
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Regular

Make a simple runtime Gambas library MyLibA and another one, say MyLibB.
MyLibB has functions that I'd like to call from MyLibA. The IDE allows MyLiB to be installed. The error occurs at runtime.
I'm using these libraries locally, i.e. on the same PC
Thanks for the reply
Posted
Regular

I can only offer you a work-around, which is to include the functions from the second library into the first, and then recompile this 'super' library.
As an example, see my post: Captain Bodgit: RaspberryPi + wiringPi + Gambas + 16x2LCD module …about half way down the page.
However, there must be a way to get this to work properly!
Posted
Regular

Excuse me,bill-lancaster said
Make a simple runtime Gambas library MyLibA and another one, say MyLibB.
so we have a " MyLibA<COLOR color="#BF0000">.gambas</COLOR> " libray and a " MyLibB<COLOR color="#BF0000">.so</COLOR> " library ?
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Regular

Yes, the obvious way is to have only one library.
Posted
Regular

we have a main program and 2 .gambas libraries (libA and libB), containing Gambas code.
Main program has to call a function in libA, this function has call a function in libB.
In Project→Property→Libraries→Add of main program you have to add both libraries (that is: libA and libB).
In this way, in your main program you can call only the function of libA (…that'll call the libB function).
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Regular

Posted
Regular

You have to load LibB.gambas in LibA.gambas (they must reside in the same folder, in the same path), and then you have to load both .gambas libraries, libA.gambas and libB.gambas, in main program.bill-lancaster said
but if LibA needs a function in LibB?
Obviously the codes of the .gambas libraries must be preceded by the key-word "Export", and the functions of the .gambas libraries must be declared as "Public".
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Regular

1 guest and 0 members have just viewed this.



