[comp.sources.d] recent ARC posting problem

iadt3tb@pyr.gatech.EDU (T. Terrell Banks) (07/07/88)

   HELP!   I'm not proficient in C (in reality I can just barely spell it).
   I un-shared all the files in the postings for ARC and typed 'make'.
   It was lovely to see all that compiling going on so nicely.  However,
   when it got to the link (?) process (you know - the 'cc -o arc' followed
   by all the '.o' files) it finished up with
                     Undefined:
                     _memset
                     *** Exit 1
                                   .  Now I'm pretty sure that it wants
   some module or routine called 'memset' in the program 'arcext.c'.
   I can't find this thing anywhere.  I'm on a Pyramid system using BSD4   
   point something Unix.  Someone please tell me where to find this module
   and how to properly get it into the source.
  
                                     Thanks,
                                       Terry Banks
  

-- 
T. Terrell Banks  uucp: ...!{akgua,ihnp4,hplabs,seismo}!gatech!gitpyr!iadt3tb
Georgia Insitute of Technology - I.S.A.      Internet: iadt3tb@pyr.gatech.edu
190 Third Street NW                                   Bitnet : iadt3tb@gitvm1
Atlanta, Georgia 30332-0185

netsourc@sonia.math.ucla.edu (Net Sources Collector) (07/08/88)

>   It was lovely to see all that compiling going on so nicely.  However,
>   when it got to the link (?) process (you know - the 'cc -o arc' followed
>   by all the '.o' files) it finished up with
>                     Undefined:
>                     _memset
>                     *** Exit 1

memset is part of the C library routines in /lib/libc.a.  At our installation
we are running UNIX BSD 4.2 and 4.3 on a Sun and VAX 11/750 respectively and 
both versions seem to have this routine in libc.a.  Here is what memset does
(as quoted from the manual page): 

char *memset(s,c,n)
char *s;
int c,n;

memset sets the first 'n' characters in memory area 's' to the value of
character 'c'.  It returns 's'.

There are two solutions to your problem:  1) Consult your local guru to
see if you have memset or a similar routine in one of the system libraries
(Sorry, but I'm not familiar with Pyramid).  2) Write your own little 
memset module (similar to the one below) in C and link it to all of the 
files which appear to be using it in the code.  From what I have observed,
arclzw.c, arcmisc.c, arcsqs.c are declaring the routine, but arcext.c is 
the only one that is actually calling it.  Good luck 8-).


char *memset(s,c,n)
	char *s;
	int c,n;
{
	register char *t;

	t = s
	while (n--)
		*t++ = c;
	return(s);
}
Edward Dergharapetian 				         (213) 206-6067
UCLA Mathematics Department.     9407A Boelter Hall.   405 Hilgard Ave.
Los Angeles, CA 90024-1555
UUCP:...!{ihnp4,ucbvax,sdcrdcf,{hao!cepu}}!ucla-cs!math.ucla.edu!edward
ARPA: edward@math.ucla.edu        BITNET: edward%math.ucla.edu@INTERBIT

steve@polyslo.UUCP (Steve DeJarnett) (07/09/88)

In article <14197@shemp.CS.UCLA.EDU> netsourc@sonia.MATH.UCLA.EDU (Net Sources Collector) writes:
>>   It was lovely to see all that compiling going on so nicely.  However,
>>   when it got to the link (?) process (you know - the 'cc -o arc' followed
>>   by all the '.o' files) it finished up with
>>                     Undefined:
>>                     _memset
>>                     *** Exit 1
>
>memset is part of the C library routines in /lib/libc.a.  At our installation
>we are running UNIX BSD 4.2 and 4.3 on a Sun and VAX 11/750 respectively and 
>both versions seem to have this routine in libc.a.  Here is what memset does
>(as quoted from the manual page): 

	Actually, it is a part of the AT&T libc.a.  True BSD probably has it
(you say it does, so I'll believe you).

>There are two solutions to your problem:  1) Consult your local guru to
>see if you have memset or a similar routine in one of the system libraries
>(Sorry, but I'm not familiar with Pyramid).  

	Well, here's the good news.  On a Pyramid, seeing as it has both the
BSD and AT&T C libraries (along with most everything else), this is quite 
easy to overcome.  Simply do the following:

	Instead of using 'cc' (the Berkeley side's cc), use the AT&T side's
cc (i.e. 'att cc').

	att cc -o arc ......................

	Or, you can simply include the AT&T side's C library by appending
the following flag on your compile:

	-l/.attlib/libc.a

	i.e.

	cc -o arc ......... -l/.attlib/libc.a

	Either one of these solutions should work (I just tried them both
on our Pyramid).

	Hope this helps.  Good luck.

-------------------------------------------------------------------------------
| Steve DeJarnett		|    ...!ihnp4!csun!polyslo!steve	      |
| Computer Systems Lab		|    ...!{csustan,csun,sdsu}!polyslo!steve    |
| Cal Poly State Univ.		|    ...!ucbvax!voder!polyslo!steve	      |
| San Luis Obispo, CA  93407	|    					      |
-------------------------------------------------------------------------------
#include <std_disclaimer.h>

steve@polyslo.UUCP (Steve DeJarnett) (07/09/88)

In article <3262@polyslo.UUCP> steve@polyslo.UUCP (Steve DeJarnett) writes:
>In article <14197@shemp.CS.UCLA.EDU> netsourc@sonia.MATH.UCLA.EDU (Net Sources Collector) writes:
>	Well, here's the good news.  On a Pyramid, seeing as it has both the
>BSD and AT&T C libraries (along with most everything else), this is quite 
>easy to overcome.  Simply do the following:
>
>	Instead of using 'cc' (the Berkeley side's cc), use the AT&T side's
>cc (i.e. 'att cc').
>
>	att cc -o arc ......................

	Well, this won't quite work.  I was thinking of another program when
I wrote this (oooooopps).  Anyway, I just tried it, so here is the PROPER
way (or at least the one that works) to do it:

	cc -o arc ........... libtws.a /.attlib/libc.a
				       ^^^^^^^^^^^^^^^
				Add this part to the end of your compile.

>	Or, you can simply include the AT&T side's C library by appending
>the following flag on your compile:
>
>	-l/.attlib/libc.a

	Whoa.  Wrong.  Won't work.  Do it as shown above.  Next time I have
to learn to proofread my postings first.  

>	Either one of these solutions should work (I just tried them both
>on our Pyramid).

	Correction, I tried similar things, but on a different program.  
Just can't keep those darn compiler flags straight in my head on a Friday
afternoon :-).

	Sorry about the screwup.  The above-mentioned way REALLY DOES WORK.
I honestly just tried it with the latest version of ARC.

-------------------------------------------------------------------------------
| Steve DeJarnett		|    steve@polyslo.UUCP                       |
| Computer Systems Lab		|    ...!{csustan,csun,sdsu}!polyslo!steve    |
| Cal Poly State Univ.		|    ...!ucbvax!voder!polyslo!steve	      |
| San Luis Obispo, CA  93407	|    					      |
-------------------------------------------------------------------------------
#include <std_disclaimer.h>