Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-30-2007, 09:23 AM   #1
Registered: May 2006
Location: India
Distribution: Redhat
Posts: 49

Rep: Reputation: 15
libtest.a uses pthread: user of libtest.a should not link pthread again

Hi all,
I have developed a library which uses pthread library calls. I want the users of my library doesn't have to call -lpthread when they link their program with my library. How can I achieve this ...

Old 01-30-2007, 11:46 AM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Users of your library *should* call "-lpthread".

If you want, you could take all the stuff lib your version of "libpthread.a" (ar xv) and add it all to your library. But that would be unwise - it would be a maintenance headache for you, and for your users.

Alternatively, you could simply ship a copy of "libpthread" (atatic or shared) with your library (as a courtesy for those users who might not happen to have their own local copy).

Old 01-31-2007, 10:23 PM   #3
Registered: May 2006
Location: India
Distribution: Redhat
Posts: 49

Original Poster
Rep: Reputation: 15
Thanks paulsm4 for you reply..

But if I am using libtool for the same purpose the users of the library have to have libtool... Am I right here??



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pthread JanusPaul Programming 8 02-09-2005 06:46 PM
pthread and C++ gt73 Programming 17 11-04-2003 04:01 AM
about pthread c12ayon Programming 6 10-25-2003 05:37 AM
need help about pthread c12ayon Programming 1 10-24-2003 08:47 AM
Pthread rch Programming 1 05-28-2003 03:20 AM

All times are GMT -5. The time now is 09:17 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration