[fpc-pascal] Re: linux: should we
hard-codeversionedorunversioned shared libraries in our apps?
ludo.brands at free.fr
Wed Aug 15 20:02:01 CEST 2012
> -----Message d'origine-----
> De : fpc-pascal-bounces at lists.freepascal.org
> [mailto:fpc-pascal-bounces at lists.freepascal.org] De la part
> de Michael Van Canneyt
> > I don't see what is wrong with that. You get a nice
> exception when you
> > try to load a different library than the one that is alread loaded.
> > But if I want to make an app that works with embedded firebird or
> > firebird client (user selectable at any time) that have completely
> > different settings (user, password, database, etc), what is I wrong
> > with creating 2 instances in the OI and connect only one at
> the time?
> IMHO that would be a total waste:
> Since you'll have to store username/password/db file anyway in some
> form of user settings, you might as well store the library
> name as well.
Wasn't that what I suggested, a libraryfilename property for the connection
component? Next to username/password/db.
> > You can't be connected the 2 at the
> > same time but that is a run-time issue, not design time.
> Because only 1 library can be loaded for each type of connection:
> the entry points are global.
That is why I said it is a runtime issue, not a design time issue.
> What you suggest implicates keeping a reference count, unloading,
> and then reloading.
> Ivo Steinmann tried implementing that once, and all his efforts
> were undone because it gave too much problems (specially the
> unloading if I recall correctly).
What you are saying is that all the code in for example ibase60.inc, where
ReleaseIBase60 calls UnloadLibrary when RefCount=0 is all unused? The
debugger says the contrary. ReleaseIBase60 is called from
> >> I think a settings dialog in the component editor (from the form
> >> designer) would be better. Or a settings dialog under 'Tools'.
> > Where would you store the value(s) then so that
> > 1) it can be streamed
> It does not need to be streamed, I imagined an IDE setting only.
Ah, that is not what I meant. Since Graeme's comments were mainly about
rolling out applications on customer machines I didn't explicitly repeat
> You pointed out that one cannot set the library for the IDE;
> I merely point out a solution for that.
Set the library -from- the IDE, ie. the Object Inspector.
> The library name to use - per type of connection - can be
> stored in the IDE settings.
I really don't see the use for such a setting on the IDE level. On the
project level it could be useful.
> I do not think a solution is required for the components.
> Yes, you cannot set the location in the OI, but I do not think
> this is needed in the first place, see the use case at the beginning.
We differ there. If it was easier to set the library file name we probably
wouldn't have all these discussions on client not found or wrong client
(embedded or not) loaded.
More information about the fpc-pascal