[comp.windows.x.motif] Widget Creation Library version 1.03 Now Available

lestat@nontech.ctt.bellcore.com (David Gonzalez-Nieves) (08/06/90)

--
Hi

        I ftp'd this package and when tried to compile got the follwing error:

        .
        .
        .
cc -c    -I/usr/local/pkg/X11/include -I. -I/usr/local/pkg/X11
/lib/X11/Wc    -DNO_ALLOCA -DXAW_BC WcRegXt.c
rm -f libWc.a
ar cq libWc.a  WcCreate.o WcCallb.o WcConvert.o WcName.o  WcRe
g.o WcActions.o WcRegXt.o
ranlib libWc.a
rm -f XCalP

cc -o XCalP  XCalP.o AriRegAll.o    -L. -lWc -lXaw -lXmu -lXt
-lXext -lX11    -lm
ld: Undefined symbol
   _strstr
*** Error code 1
make: Fatal error: Command failed for target `XCalP'
nontech>>

------

        I looked at the files and did not find any function declared with this
 name.
Does anybody know what is the problem????

        I am trying to compile on a SUN 3/60 running X11R4 SUN O.S. 4.01 and
OSF/Motif 1.0.

bye


-------------------------------------------------------- 
David Gonzalez 		lestat@ctt.bellcore.com 
Bellcore                Architecture Technology District
RRC 1M207S  			  
444 Hoes Lane
Piscatway, NJ 08854     VOICE (201) 699-6387
Internet, E-Mail:	lestat@ctt.bellcore.com
----------------------------------------------------------

DISCLAIMER:

Bellcore is not responsible for anything I say, write or think if they
can be sued. I am not resposible for anything I say, write or even think
if I can be sued. (Doesn't have any logic!!!) 

david@jpl-devvax.JPL.NASA.GOV (David E. Smyth) (08/08/90)

guy@auspex.auspex.com (Guy Harris) writes:
>david@jpl-devvax.JPL.NASA.GOV (David E. Smyth) writes:
> >    if ( strstr( res_type, "Widget")
> >#ifdef MOTIF
> >        || strstr( res_type, "Window")  /* wrong: but that's a menuWidget */
> >#endif
> >        )
> >
> >You can change the `strstr' to `strtok' and everything will work fine.
>
>If that's true, it's sure a lucky coincidence, as "strstr()" and
>"strtok()" don't do anything very much related....
>
>An N*M-time implementation of "strstr()" isn't that hard to do.

OK, OK, OK!  You are right, I was just lucky in my 10 second test...
strtok and strstr are rather different.  Here is a quick implementation
of strstr which seems to work.  I did not copy anybody elses, so you
don't have to worry about copyleft or copyright or whatever.  Please,
please, please, use an ANSI C compiler (e.g., gcc) if you can.  I
don't want to start supporting an ANSI C library!!!!!!!

For you hapless people out there who get "_strstr undefined" errors
when compiling WcCallb.c in Wcl version 1.03, just compile this and
include it on the load line:

/* copyright David E. Smyth 1990 */

char* strstr( s1, s2 )
    char* s1;
    char* s2;
{
    while (*s1)
    {
        if (*s1 == *s2)
        {
            char* start = s1;
            char* c = s2;
            while (*++s1 & *++c && *s1 == *c)
                ;
            if (*c == '\0')
                return start;
            else
                s1 = ++start;
        }
        else
        {
            s1++ ;
        }
    }
    return (char*)0;
}