Operating System - Tru64 Unix
1753943 Members
9027 Online
108811 Solutions
New Discussion

sem_open(), -lrt and creating a library

 

sem_open(), -lrt and creating a library

We are using sem_open().

Linking libraries by specifying -lrt on the compiler.

Creating a library as below:

ar cr $libdir/liboscfe.a `cat fe.libs.$$ com.libs.$$`
ranlib $libdir/liboscfe.a

Using this library in a compilation similar to the following:

aCC -D_REENTRANT -mt -g0 +DA2.0W +DS2.0 +Z -I/rr/h -Wl,+s /rr/lib//liboscfe.a -Wl,-a,default -lpthread -lm -o /rr/dbg//bin/sch2db

Getting errors given below:
......
ld: Unsatisfied symbol "sem_open" in file /rr/lib//liboscfe.a[vsllcr.o]
ld: Unsatisfied symbol "sem_close" in file /rr/lib//liboscfe.a[vsllcr.o]
ld: Unsatisfied symbol "sem_post" in file /rr/lib//liboscfe.a[vsllcr.o]
ld: Unsatisfied symbol "sem_wait" in file /rr/lib//liboscfe.a[vsllcr.o]
4 errors.

Could anybody please help?

Thanks!
1 REPLY 1
Steven Schweda
Honored Contributor

Re: sem_open(), -lrt and creating a library

1. "aCC" looks like an HP-UX C compiler, and
you're in a Tru64 forum.

2. You _say_ you're "specifying -lrt", but I
don't see it in your compile/link command.
Where, exactly, _did_ you say "-lrt"? ("-l"
is an "ld" option, so it affects a link, not
a compilation.)