Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!husc6!bu-cs!m2c!ulowell!page From: page@ulowell.cs.ulowell.edu (Bob Page) Newsgroups: comp.sys.amiga Subject: Re: A shared library (mostly) in C Message-ID: <1377@ulowell.cs.ulowell.edu> Date: Mon, 15-Jun-87 14:07:37 EDT Article-I.D.: ulowell.1377 Posted: Mon Jun 15 14:07:37 1987 Date-Received: Sun, 21-Jun-87 02:08:41 EDT References: <10090@decwrl.DEC.COM> <4410007@hpcvcd.HP> Reply-To: page@ulowell.cs.ulowell.edu (Bob Page) Organization: University of Lowell Lines: 51 >... the linker will resolve it with the first match >it comes across. So you decide which of two conflicting-name functions >you get by simply specifying the proper .lib order in your link. I guess I wasn't clear enough. Some scenarios: I buy two packages, ZIP and ZAP, from two different vendors. Each has a C run-time library called z.library that I have to install in order to have the program work. In this case, I can't use both libraries, since they are the same name. It is possible I could use FileZap and change the "z" to a "y" and hope that I got all the references. This also assumes I have FileZap and some "advanced" level of intelligence about what makes these things work. I'd say your average Joe does not, and does not want to be bothered by such matters. Maybe both have the convention that ZLibBase is the name of the base pointer each wants. Maybe both have a push() and pop() function, one for playing with windows and another for queue management, and I want to use both push()es and both pop()s. Can't do it, since the linker will find the first one only. Suppose things aren't so bad, but I have a push() and a pop() in each of two libraries and only need push() in the first library and pop() in the second. This is probably the most "normal" case of name space collisions. In this case, I cannot direct the linker to get push in lib A and pop in lib B; it will grab both from lib A or lib B depending on my command line and/or library layout. Note that some operating systems have linkers that allow you do specify individual modules from specific libraries; this would solve the problem but would also force you to keep a knowledge of what modules were contained in what libraries - a good case for using a MAKE utility. Anyway, maybe CATS sees the picture a little more clearly now. Just like SetFunction(), having versatile libraries can also be a headache if not managed correctly. Although James Synge's request that Commodore come up with either a naming convention for libraries/functions or try to somehow arbitrate them is a good one, I don't think either will work in practice, since anybody can now write C-based run-time libraries in a matter of hours and post them everywhere; naming rules be damned. I also understand that I have gone a little overboard at times with the scenarios; but I wanted to point out that the dangers are real and probably need some official CBM word other than "let the linker do it" since, as I pointed out, the linker can't usually do it. ..Bob -- Bob Page, U of Lowell CS Dept. page@ulowell.{uucp,edu,csnet}