Path: utzoo!attcan!uunet!dino!sharkey!mailrus!wuarchive!udel!mmdf From: mbeck@ai.mit.edu (Mark Becker) Newsgroups: comp.os.minix Subject: Re: Compiling zterm problems, won't link Message-ID: <24703@louie.udel.EDU> Date: 23 Sep 89 04:48:36 GMT Sender: usenet@udel.EDU Lines: 45 In article <551@fred.UUCP> bill@fred.UUCP (Bill Poitras) writes: >When I was compiling zterm under Minix 1.4a, I got the message >ctype.s, 94: _tolower mulitiple declared >This happens when compiling the 'rz' program in zterm. Why >does this happen? Is it my library? Any help would greatly be >appreciated. > I spent some time awhile ago tracking this down. lib/scanf.c has a supposedly static tolower() function buried in it and asld is getting confused. This little confusion doesn't arise with small programs; just ones over some unknown limit. Note that rz.s is around 46K. Found it by libupacking libc.a and grepping for "tolower:". Yup, two occurances. My being a complete neophyte at this level of software, I found two different ways of fixing things so they would work. I have no idea which one is "right." a) Since we now have tolower() in libc/ctype.s, comment the static function out of lib/scanf.c, re-compile lib/scanf.c, and use AR to replace it in /usr/lib/libc.a . This might require you to reorder your library to make sure that the functional tolower() occurs later in the library than scanf(). b) In zterm/rz.c, replace the reference to tolower() with _tolower() . include/ctype.h has a macro definition for _tolower() so this works as well. I just thought of another possibility (this is untried) - c) Comment out the tolower() in lib/scanf.c, replace references to it with the macro _tolower(), recompile and replace in libc.a . I did (a). Things still seem to work. scanf.s is a little smaller. I just wish I knew why we have both tolower() as a function _and_ _tolower() as a macro. Regards, Mark Becker mbeck@ai.mit.edu