sem_open(), -lrt and creating a library


 
Thread Tools Search this Thread
Operating Systems HP-UX sem_open(), -lrt and creating a library
# 1  
Old 11-02-2006
sem_open(), -lrt and creating a library

I am on HP-UX delta B.11.11

I am using sem_open() and compiling/linking the library by specifying -lrt.

Then, I am creating library like below:

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

Now, I am compiling another utility sch2db which requires this library liboscfe.a as below:

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

Compilation of sch2db requires library liboscfe.a, but I do not want to use -lrt flag here. Without -lrt I am 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 suggest a solution?

Thanks!
# 2  
Old 11-02-2006
Any particular reason you can't use -lrt? That's what it's there for.

[edit] More detail

Being your library is static, it can't link to -lrt by itself -- for that matter, it's not linked at all yet, it's just a bundle of object files. If you built a dynamic library instead, it could resolve it's own libraries.

Last edited by Corona688; 11-02-2006 at 11:34 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

What does total no. of files in ls -lrt o/p means?

when we fire ls -lrt command we see o/p as total 16 drwx------ 9 root root 8192 May 8 2002 lost+found drwxr-xr-x 2 root root 512 Jun 14 2002 TT_DB drwxrwxr-x 2 root root 512 Jul 31 2002 mail here total no. of files is always greater than... (4 Replies)
Discussion started by: Jcpratap
4 Replies

2. Linux

./configure problem for libsf library due to apparently missing libdb library.

Hello, ./configure script fails to configure libsf. Please check the following last few lines of configure script error. checking for db1/db.h... no checking for db.h... yes checking for dbopen in -ldb1... no configure: error: No libdb? No libsf. But find command shows the following; ... (4 Replies)
Discussion started by: vectrum
4 Replies

3. Shell Programming and Scripting

want to concatenate multiple files based on the rest of ls -lrt

uadm@4132> ls -lrt -rw------- 1 uadm uadm 3811819 Jun 6 04:08 data_log-2010.05.30-10:04:08.txt -rw------- 1 uadm uadm 716246 Jun 13 01:38 data_log-2010.06.06-10:04:08.txt -rw------- 1 uadm uadm 996 Jun 13 04:00 data_log-2010.06.06-10:04:22.txt -rw------- 1 uadm uadm 7471 Jun 20 02:03... (5 Replies)
Discussion started by: mail2sant
5 Replies

4. Shell Programming and Scripting

Problems with ls -lrt

I am doing ls -lrt and it does not respond and have to close the xterm ls works ok (4 Replies)
Discussion started by: kristinu
4 Replies

5. Shell Programming and Scripting

How to change a Makefile from building static library to shared library?

Hi: I have a library that it only offers Makefile for building static library. It built libxxx.a file. How do I in any way build a shared library? (either changin the Makefile or direct script or command to build shared library) Thanks. (1 Reply)
Discussion started by: cpthk
1 Replies

6. UNIX for Dummies Questions & Answers

using ls -lrt instead of ls

I have a requirement in which I shud use ls -lrt instead of ls command because when we use ls command we get an error..the script part where i get error is given below for SAPRESPONSEFILES in `ls $SAPRESPONSEGOFILE | sed "s/go/dat/g"` basically the script processes the files of format... (11 Replies)
Discussion started by: praviper
11 Replies

7. UNIX for Dummies Questions & Answers

" ls -lrt " not working ! --- Need a insight from a expert .

Hi ! All This might be a silly question.. to experts in unix. but defintely its a interesting question and I want to know the root cause. Here is the problem.... I have a Linux OS box. It has diff files systems. When I go to a DIR like this /RootDIR/NFS/myDIR and give ls -lart .. it... (4 Replies)
Discussion started by: dashok.83
4 Replies

8. Shell Programming and Scripting

find command nonrecurslu listing ls -lrt

---------------------------------------------------------------------- I have tried find . type -f -exec ls -lrt {} \; but it listed files recursively ,I need only that dir files not internal dir file. --------------------------------------------------------------------- (8 Replies)
Discussion started by: RahulJoshi
8 Replies

9. Linux

load error while creating shared library

Hi, I am trying to create shared library. When i run the script to build the library i get these errors ld: warning: option -o appears more than once, first setting taken ld: fatal: file libgc.so.0: open failed: No such file or directory ld: fatal: File processing errors. No output written... (0 Replies)
Discussion started by: masg1
0 Replies

10. UNIX for Advanced & Expert Users

sem_open problem

I can't compile these codes with g++. my system is linux (kernel is 2.4.0 ). When I try to compile this program with g++ -o semw semw.cpp It always tells me that sem_open sem_close,sem_post do not exist.But I have checked semaphore.h,I can not find any problems. Anyone can compile these codes... (2 Replies)
Discussion started by: lance
2 Replies
Login or Register to Ask a Question