SUMMARY: Need help linking with pthreads (no answer yet)

From: Rick Beebe <BEEBE_at_BIOMED.MED.YALE.EDU>
Date: Mon, 12 Jan 1998 11:26:31 -0500 (EST)

Thanks to these kind souls who took the time to respond:

  Knut.Hellebo_at_nho.hydro.com
  hs_at_spock.fscrew.fi
  bsramsey_at_CCGATE.HAC.COM
  natalia_at_stn-atlas.com.au

Alas, none of their suggestions worked. Does anyone else have any ideas?
Also, does anyone know how to do the equivelent of 'ar -t' on libpthread.so?
ar doesn't like .so libraries. The only additional information I can
provide is that the man pages for cxx refer to a -threads flag rather than
a -pthread flag (which is in the cc man pages). I tried that as well.
Didn't hurt but didn't help either.

  _______________________________________________________________________

    Rick Beebe (203) 785-4566
    Network Engineering Manager FAX: (203) 737-4037
    ITS-Med Technology Operations Richard.Beebe_at_yale.edu
    Yale University School of Medicine
    P.O. Box 208089, New Haven, CT 06520-8089
  _______________________________________________________________________

My original message and clips of some of the responses:

> I'm trying to compile a C++ application (mysql) which requires pthreads on a
> DU 4.0 machine. There is no libpthreads.a on the machine, only
> libpthreads.so (a search through the archives showed that this is 'normal'
> for this version of the OS though it would hopefully be corrected in future
> versions. I'll be looking at 4.0d when it comes out).
>
> During my initial compilation attempts, linking failed with unresolved
> symbol 'pthread_self'. I added -call_shared and it compiled and linked
> without error. But when I try to run the application it dies with
> 'unresolvable symbol: pthread_self_Xv'.
>
> The actual compile lines look similar to:
>
> cxx -pthread -call_shared -O -c mysqld.cc
>
> with the link:
>
> cxx -pthread -call_shared -O -o mysqld mysqld.o -lpthread -lmach -lexc -lc


Did you install the C++ runtime libs as well ? If not, try installing
C++ runtime and rerun the application.

(yes, I did).

- Try to add -lpthreads to the link options - I recall it has some of the
necessary symbols. (Notice that -lpthread is not the same as -lpthreads!)
- You should not need -call_shared..

(didn't help)

     We had a similar problem with some ADA code on a 4.0b system. We had
     to add the following library to the makefile...
          
        /usr/opt/alt/usr/lib/threads

(I don't have such a library. Couldn't find it on the CD either. Perhaps
that's the libpthread.a that didn't ship with 4.0?)
     
Received on Mon Jan 12 1998 - 17:35:44 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:37 NZDT