From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,4056fd8d47803409 X-Google-Attributes: gid1164f8,public From: Dave Butenhof Subject: Re: pthreads Date: 1996/02/07 Message-ID: <31189FF0.41C6@zko.dec.com>#1/1 X-Deja-AN: 138812924 references: cc: broch+@andrew.cmu.edu content-type: text/plain; charset=us-ascii organization: SCE mime-version: 1.0 newsgroups: comp.sys.dec x-mailer: Mozilla 2.0 (X11; I; OSF1 T4.0 alpha) 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" ------------------------------------------------------------------------