[comp.unix.sysv386] Missing C library functions in INTERACTIVE 386/ix 2.0.2?

jdg0@GTE.COM (Jose Diaz-Gonzalez) (01/05/91)

Hi there,

My libc.a seems to be missing the functions defined in regcmp(3) (regcmp
and regex).  I tried the shared library version with no luck. Nm does not 
find it in either one.  Any ideas?  Cheers,

	-- Jose

dag@gorgon.uucp (Daniel A. Glasser) (01/06/91)

In article <10325@bunny.GTE.COM> jdg0@GTE.COM (Jose Diaz-Gonzalez) writes:
>My libc.a seems to be missing the functions defined in regcmp(3) (regcmp
>and regex).  I tried the shared library version with no luck. Nm does not 
>find it in either one.  Any ideas?  Cheers,

regex/regcmp are found in libPW.a (/lib/libPW.a) and not in libc.a (or
libc_s, for that matter.)  Tack "-lPW" after your other files in the
link stage, and you'll get them.

This is true for ISC 2.0.2 and ISC 2.2, and I suspect most other versions.
(I don't know about other flavors/versions of SysV, but that's where it
was in SysIII too.)

Many people will post "RTFM" responses, but actually, the ISC man pages
for regex and regcmp don't mention libPW at all.  (My sys-3 man pages
do list libPW.a in the FILES section.)

-- 
Daniel A. Glasser                       One of those things that goes
dag%gorgon@persoft.com                  "BUMP! (ouch!)" in the night.

gil@limbic.ssdl.com (Gil Kloepfer Jr.) (01/06/91)

In article <10325@bunny.GTE.COM> jdg0@GTE.COM (Jose Diaz-Gonzalez) writes:
>My libc.a seems to be missing the functions defined in regcmp(3) (regcmp
>and regex).  I tried the shared library version with no luck. Nm does not 
>find it in either one.  Any ideas?  Cheers,

If you look more carefully, you will see that you need to link with
/lib/libPW.a.  Just specify -lPW on your cc command line

-- 
Gil Kloepfer, Jr.              gil@limbic.ssdl.com   ...!ames!limbic!gil 
Southwest Systems Development Labs (Div of ICUS)   Houston, Texas
"There are beautiful people I wish would have never opened their mouths,
because such ugliness oozes out."  Philosophy Prof. at NYIT

allbery@NCoast.ORG (Brandon S. Allbery KB8JRR) (01/07/91)

As quoted from <10325@bunny.GTE.COM> by jdg0@GTE.COM (Jose Diaz-Gonzalez):
+---------------
| My libc.a seems to be missing the functions defined in regcmp(3) (regcmp
| and regex).  I tried the shared library version with no luck. Nm does not 
| find it in either one.  Any ideas?  Cheers,
+---------------

They can't find it because it's not in libc.a.  It's in libPW.a.  Try loading
with -lPW.

(Warning to SCO UNIX users:  SCO moved them to libc.a, which means you have to
watch out when writing programs under SCO UNIX that are intended to be
portable to other platforms.  (Not to mention the bug that causes them to only
work when linked by the cc command, but not by rcc, gcc, etc.)  Sigh....)

++Brandon
-- 
Me: Brandon S. Allbery			    VHF/UHF: KB8JRR on 220, 2m, 440
Internet: allbery@NCoast.ORG		    Packet: KB8JRR @ WA8BXN
America OnLine: KB8JRR			    AMPR: KB8JRR.AmPR.ORG [44.70.4.88]
uunet!usenet.ins.cwru.edu!ncoast!allbery    Delphi: ALLBERY

ggw%wolves@cs.duke.edu (Gregory G. Woodbury) (01/07/91)

In article <132@limbic.ssdl.com> gil@limbic.ssdl.com (Gil Kloepfer Jr.) writes:
>In article <10325@bunny.GTE.COM> jdg0@GTE.COM (Jose Diaz-Gonzalez) writes:
>>My libc.a seems to be missing the functions defined in regcmp(3) (regcmp
>>and regex).  I tried the shared library version with no luck. Nm does not 
>>find it in either one.  Any ideas?  Cheers,
>
>If you look more carefully, you will see that you need to link with
>/lib/libPW.a.  Just specify -lPW on your cc command line

	Good answer!  however, be aware that the libPW.a archive has all
sorts of things in it that could potentially conflict whit software from
all over the place.  For example, there is a "rename" entry in the PW
library that is NOT posix or BSD compatible!  Trying to use libPW in
a situation where you need a posix rename(2) is going to cause trouble.

	The best solution I have found was to use that ar command to
extract the two object modules concerned, regex.o and regcmp.o, from the
libPW archive and make another archive /usr/lib/libregex.a to hold them.
Then for programs that need regex, I can tell the makefile to include
-lregex in the link step (as a termial argument to the c compiler).

	BTW, if you want posix stuff for some of the older system 5s out
there (like sVr2) check out the posix library that Eric Raymond has in
the beta TMNN-netnews (available from uunet).
-- 
Gregory G. Woodbury @ The Wolves Den UNIX, Durham NC
UUCP: ...dukcds!wolves!ggw   ...mcnc!wolves!ggw           [use the maps!]
Domain: ggw@cds.duke.edu     ggw%wolves@mcnc.mcnc.org
[The line eater is a boojum snark! ]           <standard disclaimers apply>

chip@tct.uucp (Chip Salzenberg) (01/08/91)

According to ggw%wolves@cs.duke.edu (Gregory G. Woodbury):
>	The best solution I have found was to use that ar command to
>extract the two object modules concerned, regex.o and regcmp.o, from the
>libPW archive and make another archive /usr/lib/libregex.a to hold them.

This procedure is also useful for the routines in /lib/libx.a (the
Xenix library).  Libx includes a version of opendir/readdir/closedir
incompatible with the standard C library and <dirent.h>.  However, I
want to use chsize(), nap() and rdchk().  So extracted those objects,
put them in /u/local/lib/libxenix.a, and link with -lxenix.  Presto.
-- 
Chip Salzenberg at Teltronics/TCT     <chip@tct.uucp>, <uunet!pdn!tct!chip>
       "If Usenet exists, then what is its mailing address?"  -- me
             "c/o The Daily Planet, Metropolis."  -- Jeff Daiell

hugh@fivegl.co.nz (Hugh Grierson) (01/09/91)

In article <1991Jan6.165120.23958@NCoast.ORG> allbery@ncoast.ORG (Brandon S. Allbery KB8JRR) writes:
>As quoted from <10325@bunny.GTE.COM> by jdg0@GTE.COM (Jose Diaz-Gonzalez):
>+---------------
>| My libc.a seems to be missing the functions defined in regcmp(3) (regcmp
>| and regex).  I tried the shared library version with no luck. Nm does not 
>| find it in either one.  Any ideas?  Cheers,
>+---------------
>
>They can't find it because it's not in libc.a.  It's in libPW.a.  Try loading
>with -lPW.
>
>(Warning to SCO UNIX users:  SCO moved them to libc.a, which means you have to
>watch out when writing programs under SCO UNIX that are intended to be
>portable to other platforms.  (Not to mention the bug that causes them to only
>work when linked by the cc command, but not by rcc, gcc, etc.)  Sigh....)
>

I was bitten on our SVR4 - it's in libgen.a.  Good grief.

This is on an ICL DRS6000 [SPARC], running ICL's port of SVR4 - I don't know
who is responsible for the change... but apparently ICL is responsible for
the definitive SPARC port for AT&T.  Maybe someone can confirm or clarify 
this for me.

Ta muchly.

-- 
Hugh Grierson         | hugh@fivegl.co.nz  | This space intentionally
5GL International Ltd | PH:  +64.9.3021621 |    left non-blank.
Auckland, New Zealand | FAX: +64.9.3021617 |

ronald@robobar.co.uk (Ronald S H Khoo) (01/10/91)

chip@tct.uucp (Chip Salzenberg) writes:

> Libx includes a version of opendir/readdir/closedir
> incompatible with the standard C library and <dirent.h>.  However, I
> want to use chsize(), nap() and rdchk().  So extracted those objects,
> put them in /u/local/lib/libxenix.a, and link with -lxenix.  Presto.

What's wrong with just deleting the ndir objects from libx ?
That way, you don't have to mess with other people's Makefiles :-)
-- 
ronald@robobar.co.uk +44 81 991 1142 (O) +44 71 229 7741 (H)

allbery@NCoast.ORG (Brandon S. Allbery KB8JRR) (01/11/91)

As quoted from <1991Jan9.045512.13620@fivegl.co.nz> by hugh@fivegl.co.nz (Hugh Grierson):
+---------------
| In article <1991Jan6.165120.23958@NCoast.ORG> allbery@ncoast.ORG (Brandon S. Allbery KB8JRR) writes:
| >As quoted from <10325@bunny.GTE.COM> by jdg0@GTE.COM (Jose Diaz-Gonzalez):
| >+---------------
| >| My libc.a seems to be missing the functions defined in regcmp(3) (regcmp
| >| and regex).  I tried the shared library version with no luck. Nm does not 
| >+---------------
| >
| >They can't find it because it's not in libc.a.  It's in libPW.a.  Try loading
| >with -lPW.
| >
| >(Warning to SCO UNIX users:  SCO moved them to libc.a, which means you have to
| 
| I was bitten on our SVR4 - it's in libgen.a.  Good grief.
+---------------

Well, I just found out that the SCO UNIX "bug" was caused by two formerly
***STATIC*** (in SVR3.1) functions moving to libintl.a.  Sheesh.

Where does real honest-to-AT&T SVR3.2 put the regexp stuff?

++Brandon
-- 
Me: Brandon S. Allbery			    VHF/UHF: KB8JRR on 220, 2m, 440
Internet: allbery@NCoast.ORG		    Packet: KB8JRR @ WA8BXN
America OnLine: KB8JRR			    AMPR: KB8JRR.AmPR.ORG [44.70.4.88]
uunet!usenet.ins.cwru.edu!ncoast!allbery    Delphi: ALLBERY

tneff@bfmny0.BFM.COM (Tom Neff) (01/11/91)

In article <1991Jan11.033443.17289@NCoast.ORG> allbery@ncoast.ORG (Brandon S. Allbery KB8JRR) writes:
>Where does real honest-to-AT&T SVR3.2 put the regexp stuff?

In libPW.a.  Also in libform.a, if you have the FMLI package.

This is from vanilla AT&T V/386 3.2.1.

-- 
Diplomacy is the art of saying     *-/O     Tom Neff
"Nice doggie" until you can        |//|     tneff@bfmny0.BFM.COM
find a rock.  -- Will Rogers       O/-*     uunet!bfmny0!tneff

jsmithso@aut.autelca.ascom.ch (Jim Smithson) (01/14/91)

It's in libPW.a in the "real" AT&T SysVR3.2 (At least on 3B2s).
-- 
James R. Smithson	Ascom Autelca AG      CH-3073 Guemligen/Switzerland
E-mail: jsmithso@autelca.ascom.ch   FAX: +41 31 527 528  Voice : +41 31 529 214
UUCP: ...!uunet!mcsun!chx400!hslrswi!aut!jsmithso