From: Dave Butenhof <butenhof@zko.dec.com>
Cc: broch+@andrew.cmu.edu
Subject: Re: pthreads
Date: 1996/02/07 [thread overview]
Message-ID: <31189FF0.41C6@zko.dec.com> (raw)
In-Reply-To: Ul60J8K00ioBAI84Zr@andrew.cmu.edu
Joshua Broch wrote:
>
> Is anyone aware of a problem with the pthreads library for DEC Unix? If
> I take a perfectly normal program, such as a hello world program, and
> link it in with the pthreads library, the program SEGFAULTS immediately
> on execution.
>
> Any Ideas?
This sort of question is fairly pointless without specifics. Such as,
what version of Digital UNIX? What's the program? How are you compiling
and linking? What options to compiler & linker? Shared or nonshared?
My guess is that you've linked it incorrectly. The correct way to
compile and link a simple C program on Digital UNIX 3.x that uses
threads is something like
cc -o hello -threads hello.c
If you're linking a shared library, or a C++ program (using an older
C++ without support for -threads), you need the following library
options AT THE END of the ld (or cxx) command...
-lpthreads -lmach -lc_r -lc
If you're testing Digital UNIX 4.0, that'd still be fine if you're
using the old cma or 1003.4a/D4 interfaces -- but you should be using
the 1003.1c-1995 interface and compiling with "-pthread" or linking
with "-lpthread -lmach -lexc -lc".
------------------------------------------------------------------------
Dave Butenhof Digital Equipment Corporation
butenhof@zko.dec.com 110 Spit Brook Rd, ZKO2-3/Q18
Phone: 603.881.2218, FAX: 603.881.0120 Nashua, NH 03062-2711
"Better Living Through Concurrency"
------------------------------------------------------------------------
next prev parent reply other threads:[~1996-02-07 5:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-02-06 5:00 pthreads Joshua Broch
1996-02-07 5:00 ` Dave Butenhof [this message]
1996-02-07 5:00 ` pthreads Daniel S. Riley
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox