help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pthreads


From: Matthew Polder
Subject: Re: pthreads
Date: Mon, 02 Aug 2004 10:52:35 -0400


You are correct, I am linking statically. I did look in /usr/lib and saw
libpthread.so, so I guess I will need to start building dynamic
libraries (I have successfully avoided it up to this point).

However, before using gcc, I was using Sun's C++ compiler, CC. With this
compiler I was able to link statically and have my threads work. I used
the '-mt' flag in compiling and linking and it took care of everything.
I wonder what library it used.

Since =pthreads is not really documented in the gcc manual, is there
another reference where one can learn these things?

thanks,
matthew

Paul Pluzhnikov wrote:
> 
> Paul Pluzhnikov <ppluzhnikov-nsp@charter.net> writes:
> 
> > Matthew Polder <matthewtunapolder@kodak.com> writes:
> 
> > > then it complains about not finding the pthreads library (I'm not sure
> > > where it is).
> >
> > That is even harder to believe, since on Solaris 5.8 libpthread.so
> > is installed in /usr/lib by default.
> 
> I just realized why you don't find libpthread when you link with
> '-pthreads': you probably are trying to link with '-static'.
> 
> On Solaris, libpthread.a does not exist and static linking of
> threaded executables is not supported.
> 
> Further, static linking of executables on any UNIX is a bad idea(TM).
> 
> Cheers,
> --
> In order to understand recursion you must first understand recursion.
> Remove /-nsp/ for email.

-- 



Please remove the word 'tuna' from my name and add a dot j dot ('.j.')
for my correct email address. If you are a spammer please add the word
"Istink" after the word tuna.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]