Re: Setting up libraries
Posted in 1998
David wrote: > > Hi, > > Having previously worked on 4GL V4, I used to create libraries like > this: > > ar -rs libdriver.a some_function1.o some_function2.o > cp libdriver.a /lib > > Then, if any of the functions included in the library were re-compiled > and the libdriver.a updated, there was no need to re-compile any other > program that used these functions. I think this was becuase the other > programs will have been compiled and linked with libdriver.a and so at > runtime they would call up the new function. > > Now that I am working with RDS V4.20 and SE 5.10 I don't think I have > this option anymore. > > Can anyone suggest a way of creating re-useble functions that can be > called upon without having to re-compile other program that would want > to use them? Well not quite to get the runtime functionality you described you would have had to create a shared library, usually named something like libdriver.so, which is created by the linker (ld) not by the archiver (ar) which creates normal non-shared libraries. To do this with RDS you can link a new runner with any "C" functions and new executions will get the newly linked runner. You can create libraries of pcode to "link" together just using cat: cat func1.4go func2.4go func3.4go >functslib.par then to "link" a new R4GL executable you would: cat mainline.4go appfuncs.4go functslib.par >appexec.4ge It's been a few years since I used RDS but that looks like how I used to do this. It is not dynamic but it works. Perhaps a valid R4GL feature request is the ability to load such a library in the runner at execution time on the command line along with the mainline, such as: fglpc -l funcslib.par mainline.4ge Art S. Kagel